[FFmpeg-devel] Rework color quantization in palette{gen,use}

Clément Bœsch u at pkh.me
Tue Nov 8 23:07:46 EET 2022


On Sun, Nov 06, 2022 at 07:46:38PM +0000, Soft Works wrote:
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> > Clément Bœsch
> > Sent: Saturday, November 5, 2022 4:26 PM
> > To: ffmpeg-devel at ffmpeg.org
> > Subject: [FFmpeg-devel] Rework color quantization in palette{gen,use}
> > 
> > Hi,
> > 
> > This patchset essentially fixes a few core problems in these filters
> > and
> > switches to a perceptual model.
> > 
> > I've generated a report for each key commit on this (temporary) page:
> > http://big.pkh.me/pal/ (warning: heavy page, ~500M; I did try to add
> > some lazy
> > loading of the images but I'm not sure it's actually working as
> > expected).
> 
> Comparing the results for the known and simple "rainbow O" example reveals
> that the proposed implementation seems to be even inferior to the current 
> code and even farther away from what is possible to achieve:
> 
> https://gist.github.com/softworkz/e310e3c84a338f98977d70b09e3e3f4f

The pngquant file on this page has 373 unique colors, and the transparency
is fake (the checkerboard is opaque white & grey). I think there is a
mistake here.

WRT the regression after the patch, I confirm that there is a problem
related to the dithering. If you try with dither=none or even
dither=bayer, you'll observe that the colors are much better. I will
update the results page at some point to include that file.

Now indeed the sierra dithering (and probably the other of the same type)
are somehow spreading way too strongly, it's unclear to me yet but that
might be a bug I introduced. I'll investigate, thanks.

Regards,

-- 
Clément B.


More information about the ffmpeg-devel mailing list