[FFmpeg-devel] Scaling PAL8 images with alpha

Tomas Härdin tjoppen at acc.umu.se
Fri Sep 24 18:33:38 EEST 2021


fre 2021-09-24 klockan 10:30 +0000 skrev Soft Works:
> Hi,
> 
> for a new filter, I want to rescale PAL8 subtitle bitmaps where the
> palette includes
> colors with alpha.

Isn't this typically done at the player level? What's your use case?

> 
> From what I’ve seen, swscale doesn’t support PAL8-to-PAL8, only PAL8-
> to-BGR8
> which doesn’t support alpha and the palette is fixed with 256 entries
> defined by
> convention, while I would ideally like to be able to allow the
> following:
> 
> - constrain the output to use the same palette as the input

Nearest neighbor scaling should be able to do this.

> - adaptively quantize it to a palette with a configurable number of
> colors

Palette generation is typically an offline process, via palettegen as I
said on IRC

/Tomas



More information about the ffmpeg-devel mailing list