There are only a handful of levers on a GIF, and they are not equally good. Some remove bytes you never wanted. Others remove bytes that were the whole point of the image. Working in the right order is the difference between a GIF that shrank 70% and looks identical, and one that shrank 70% and looks like a fax.
1. Cut the duration — free
File size scales almost linearly with frame count. Halving a six-second loop to three seconds halves the file and costs you nothing but the part you probably did not need. This is always the first move: a GIF's job is usually to show one moment, and most GIFs show three.
2. Drop frames that do not change — nearly free
Screen recordings are full of identical consecutive frames. Merging them (keeping the total duration by adding the delays together) is invisible. On UI demos and slideshows this alone can halve the file. The compressor does this with Merge identical frames.
Why it works: GIF stores full frames. Two identical frames cost twice as much as one. The only reason they exist is that the capture software recorded at a fixed rate.
3. Reduce dimensions — the best quality-per-byte trade
File size tracks pixel count, so 50% width is 25% of the pixels — typically a 60–75% reduction. It is the single largest lever that still produces a good-looking result, because human vision is forgiving about resolution and unforgiving about colour banding.
If the GIF will be viewed at 320 px wide, storing it at 960 px wastes nine tenths of the file. Match the pixels to the display size and no further.
4. Reduce the palette — cheap up to a point
256 colours down to 128 is usually invisible on photographic content, because the source never had clean gradients anyway. 64 starts to show on skin tones and skies. Below 32 you are choosing an aesthetic.
The exception is flat graphics — logos, diagrams, screenshots of text, pixel art. Those often use fewer than 32 colours genuinely and lose nothing at 16.
5. Use one shared palette — small win, occasionally a big one
Each per-frame palette costs up to 768 bytes in the file. On a 100-frame GIF that is up to 75 KB of pure overhead, which on a 200 KB target is a third of your budget. A single global palette removes it. The cost is banding when consecutive frames differ a lot in colour — rare in animation, common in slideshows.
6. Turn off dithering — counterintuitive but real
Dithering hides banding by adding a fine noise pattern. LZW compression, which is what GIF uses, finds repeated byte sequences — and noise has none. Turning dither off can shrink a file by 10–20% at the cost of visible banding in gradients. For flat graphics there is no cost at all, because there were no gradients to band.
7. Reduce frame rate
12 fps to 8 fps removes a third of the frames. Motion gets choppier but the eye adapts quickly, especially on short loops. Below 8 fps the illusion of motion breaks down and it reads as a slideshow.
8. Crop to the subject
Cropping is resizing by another name, but it removes pixels that carried no information — the empty desktop wallpaper around a window recording, the black bars, the margin. A tight crop followed by a smaller resize often beats resizing alone, because the subject keeps more pixels.
9. Convert to MP4 or WebM — the honest answer
Not a GIF afterwards, but 5–10× smaller for identical content and better colour. If the destination accepts video, this beats every technique above combined. X, Reddit, WhatsApp, and Facebook all do it to your GIF automatically on upload.
When compression makes the file bigger
This happens, and it confuses people. The usual cause: the original GIF was saved by a tool that used delta frames — an initial full frame, then small patches containing only the pixels that changed. That is dramatically more efficient than storing full frames.
When you resize or re-encode, every frame has to be expanded to a full canvas first (you cannot scale a patch independently — its coordinates would no longer match). Then all frames are written in full. A 900 KB delta-optimised GIF can become a 1.5 MB full-frame GIF even at identical dimensions.
The partial fix is frame merging. The real fix is accepting that the original was already near the floor for its format, and converting to video instead.
A worked example
A 6-second screen recording of a UI animation, 1280×720, 25 fps, 4.8 MB. Applying the levers in order:
| Step | Size | Change | Visible cost |
|---|---|---|---|
| Original | 4.8 MB | — | — |
| Merge identical frames | 3.1 MB | −35% | None |
| Resize to 640 px | 800 KB | −74% | Slightly softer text |
| Palette 256 → 128 | 560 KB | −30% | Almost none |
| Dither off | 470 KB | −16% | None (flat UI colours) |
| As MP4 instead | 120 KB | −97% | No transparency, needs a player |
Ten-fold reduction while still recognisably the same GIF, and a forty-fold reduction by changing format. The numbers will differ for your file — the shape of the curve will not.