3 ms·
That's cool. Have you tried to make GIF compression lossy? The idea is that when looking for longest match in the dictionary you don't match colors exactly, bu
by pornel 14y ago
That's cool. Have you tried to make GIF compression lossy?
The idea is that when looking for longest match in the dictionary you don't match colors exactly, but instead allow some difference. That can reduce file size by 20-30% (here's my take on it in C: https://github.com/pornel/giflossy/commit/5a9adbc0feb899a228ed068a0deec6fc1b954a85?w=1#L0L245 https://github.com/pornel/giflossy/commit/5a9adbc0feb899a228...)
Another optimization is to set pixels that are similar between frames to transparent color. That sometimes massively improves quality, as you only generate palette for part of the image (so the palette is better) and several frames overlaid together may give more than 256 colors.
- rwinn 14y agoThat's really interesting, i had a look at your test images and they look great (http://pornel.net/lossygif http://pornel.net/lossygif for the curious :) definitely something worth implementing As for the transparency trick, do you have some example i can have a look at? I didn't know you can layer gif frames on top of each other like that
- nitrogen 14y agoThe GIMP includes an "Optimize (for GIF)" command (it might be in gimp-gap) that deletes all pixels in subsequent frames that are equal to the most recent value for that pixel. Unfortunately, GIMP doesn't support per-frame/per-layer colormaps.