4 ms·
LZW compression is primitive. Even in simplest case of all transparent pixels it can only do "repeat previous pattern and add 1 pixel to it" and has to start ov
by pornel 14y ago
LZW compression is primitive. Even in simplest case of all transparent pixels it can only do "repeat previous pattern and add 1 pixel to it" and has to start over every 4K repetitions.
But it's also easy to hack! I've developed lossy GIF compressor: http://pornel.net/lossygif http://pornel.net/lossygif
it's still worse than PNG, but would be awesome for animations. Anyone wants to help? https://github.com/pornel/giflossy/ https://github.com/pornel/giflossy/
- Scaevolus 14y agoI never considered how LZW doesn't do RLE! LZW was probably chosen over Deflate for simplicity reasons. Maybe webP's complexity has been hurting its adoption? How does giflossy work? I don't see an explanation on that page.
- pornel 14y agolossy is simple — in the "pick the longest matching string from the dictionary" the match is allowed to be imperfect. GIF lives because it's expected to work everywhere. WebP so far isn't even a first-class citizen in Google's world :(