What's the difference between lossy and lossless GIF compression — and which should you use?
Lossless GIF compression finds patterns in the pixel data and encodes them more efficiently — without changing a single pixel. Gifsicle's --optimize flag does this by:
This typically achieves 10–30% reduction on unoptimized GIFs. On already-optimized GIFs, the gain is smaller.
Lossy GIF compression (Gifsicle's --lossy flag) deliberately alters pixel colors to create longer LZW run-length sequences. This makes the compression algorithm much more effective at the cost of visible artifacts:
--lossy=20: very subtle, barely noticeable--lossy=80: moderate dithering and color banding in gradients--lossy=200: significant artifacts, blocky appearanceReducing the number of colors in the palette is technically lossless within the reduced palette — the encoder picks the best 64 or 128 colors and maps all other pixels to the nearest match. This is highly effective and often yields 20–50% size reduction with minimal perceptual quality loss on simple GIFs.
| Goal | Technique |
|---|---|
| Preserve quality entirely | Lossless optimize only |
| Moderate compression | Reduce colors to 128 |
| Aggressive compression | Reduce colors to 64 + lossy=20–50 |
| Maximum compression | Reduce colors to 32 + lossy=80–200 + resize |
GifMash's Quality slider maps across these tiers automatically. The Target Size mode combines all three techniques in a binary search to hit your exact KB target.
Try both compression modes
GifMash's Quality tab applies lossless optimization first, then lossy — use the slider to find your sweet spot.