3 ms·
If you want high-quality palette try libimagequant: http://pngquant.org/lib http://pngquant.org/lib pngquant's method is superior to octtree: • it uses Vorono
by pornel 12y ago
If you want high-quality palette try libimagequant: http://pngquant.org/lib http://pngquant.org/lib
pngquant's method is superior to octtree:
• it uses Voronoi iteration to get local minimum and minimize effects of axis-aligned subdivisions
• it uses sort-of gradient descent to optimize subdivisions
• to some degree edges and noise are included in histogram weights
• does not need to throw away any bits of precision (most implementations just naively discard 2-3 bits, because of RAM limits in '80-'90s)
pngquant undithered:
http://i.imgur.com/fOkZDjA.png http://i.imgur.com/fOkZDjA.png
vs leptonica's:
http://www.leptonica.com/figs/tree-nodither.jpg http://www.leptonica.com/figs/tree-nodither.jpg
- nitrogen 12y ago(most implementations just naively discard 2-3 bits, because of RAM limits in '80-'90s) Might it also have something to do with earlier VGA DACs having 6 bits per color channel? I seem to remember that newer video cards required setting a separate register to enable eight-bit-per-channel palette entries. Edit: never mind, the discussion of Wu's algorithm in another thread, specifically https://news.ycombinator.com/item?id=9216252 https://news.ycombinator.com/item?id=9216252, makes the RAM limitation clear.