[FFmpeg-devel] [PATCH v2 01/32] avfilter/palettegen: allow a minimum of 2 colors

Clément Bœsch u at pkh.me
Wed Dec 28 23:23:14 EET 2022


On Wed, Dec 28, 2022 at 10:04:26PM +0100, Tomas Härdin wrote:
[...]
> Does this mean all-black with transparent is disallowed?

Yes a single color with or without an extra transparency slot makes no
sense.

> Shouldn't it be max_colors + reserve < 2?

max_colors accounts for the transparent color as well. So if you specify
256 colors with reserve_transparent (default settings), you'll get 255
color slots and 1 for transparency.

It also means that if want to go as low as 2 colors in your palette you
can do max_colors=3 with reserve_transparent=1, or max_colors=2 with
reserve_transparent=0

  3-1 → 2
  2-0 → 2

These are the minimums.

PS: sorry for the double answer Tomas!

-- 
Clément B.


More information about the ffmpeg-devel mailing list