On Fri, Sep 24, 2021 at 10:30:31AM +0000, Soft Works wrote:
> Hi,
> 
> for a new filter, I want to rescale PAL8 subtitle bitmaps where the palette 
> includes
> colors with alpha.
> 
> 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
> - adaptively quantize it to a palette with a configurable number of colors
> 
> Thus it's about the palette quantization (with or without dithering) after 
> scaling in RGBA. (or some cool algorithmic trick I'm not aware of)
> 
> Is there any existing code that I could reuse? The closest I could find
> is pngenc, but I'm wondering whether there's something else/better 
> somewhere in the ffmpeg libs that I haven't seen?

There are some non linear scaling filters which may make sense when you do
not have the full linear space available see:
hqx, epx, xbr
you could also try some neural net stuff
or the insane solution, OCR, scale text, render font into RGBA and then back to 
PAL8

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to