Skip to content
GifSmaller

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

Questions

Is lossless GIF compression really lossless?

Yes. The decoded frames are pixel-for-pixel identical to the original. Only the way the data is stored changes.

What lossy level should I use?

Start low (around 30–60). If the file is still too big, increase gradually and compare the preview. Above about 120, grain usually becomes visible.

Does lossy compression reduce the number of colors?

No, that is a separate setting. Lossy compression changes how pixels are encoded; color reduction limits the palette. You can combine both.