Lossy vs lossless GIF compression
1 min read
GIF compression comes in two flavors. Understanding the difference helps you get the smallest file that still looks right.
Lossless: same pixels, less data
A GIF stores each frame as palette indexes compressed with LZW. Lossless optimization keeps every pixel identical but stores them more efficiently:
- Frame differencing — store only the rectangle that changed since the previous frame.
- Transparency — mark unchanged pixels as transparent, which compresses better.
- Palette cleanup — drop unused colors and redundant metadata.
Savings are usually 10–40%, and the result is pixel-for-pixel identical. There is no reason not to do it, which is why GifSmaller always starts here.
Lossy: slightly different pixels, much less data
Lossy GIF compression (gifsicle’s --lossy option) lets the encoder choose a nearby pixel value when it makes the LZW data compress better. The image stays a GIF and keeps its timing, but small details change.
| Lossless | Lossy | |
|---|---|---|
| Pixels change? | No | Slightly |
| Typical extra savings | — | 30–70% |
| Visible artifacts | None | Grain, speckles at high levels |
| Best for | Every GIF | Hitting a size limit |
Artifacts show up first in smooth gradients, skies and skin tones. Flat cartoon colors and text hide them well.
Other ways to shrink a GIF
Lossy and lossless are not the only tools:
- Fewer colors (e.g. 256 → 64) — good for flat graphics, causes banding in photos.
- Smaller dimensions — the strongest lever; size scales with pixel area.
- Fewer frames — changes the animation, so do it deliberately.
How GifSmaller chooses
With a target size, GifSmaller tries lossless first, then searches for the lowest lossy level that fits, and only then reduces dimensions. In Advanced mode you set lossy level, colors and size yourself and compare the preview. Read how to make a GIF smaller for a step-by-step walkthrough.
Try it on your GIF
Compress it in your browser. Free, and nothing is uploaded.
Open the compressor