2 ms·
There is a version of pngquant that uses Wu's algorithm: https://github.com/pornel/pngquant/tree/wucut https://github.com/pornel/pngquant/tree/wucut However,
by pornel 13y ago
There is a version of pngquant that uses Wu's algorithm:
https://github.com/pornel/pngquant/tree/wucut https://github.com/pornel/pngquant/tree/wucut
However, Wu's algorithm requires preprocessing R * G * B * A * int array, which is 16GB of RAM if done at full RGBA quality, so in practice all implementations have to drop alpha and/or heavily posterize colors.
pngquant the same goal — subdivides RGBA (hyper)cube to minimize variance in each section — but does it with much less memory and can do it at full quality.
Posterization of input is my pet peeve, as it gives images slightly banded and grainy look that we associate with "256-color" images (since VGA only ever supported 6-bit per gun), and presume 256 colors are never enough for photorealistic look — but it often is, and people who use e.g. TinyPNG service think it's magic.
- leeoniya 13y agoyeah, i discovered how much space it needed when porting it via emscripten to asm.js
- pornel 13y agoIt'd be awesome to port pngquant to JS, especially that JS is getting parallelization and SIMD now. Unfortunately I never got emscripten to work on my machine. Could you give it a try and compile http://pngquant.org/lib http://pngquant.org/lib?
- leeoniya 13y agosure i can give it a go. though i'm currently stuck in an airport going on 14h. i'll ping you when i get around to it but could be a few days