How to reduce GIF file size: nine methods, ranked

Ordered by how much size each one removes per unit of visible quality lost.

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:

StepSizeChangeVisible cost
Original4.8 MB——
Merge identical frames3.1 MB−35%None
Resize to 640 px800 KB−74%Slightly softer text
Palette 256 → 128560 KB−30%Almost none
Dither off470 KB−16%None (flat UI colours)
As MP4 instead120 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.

Questions people actually ask

What is the single most effective way to shrink a GIF?

Reduce the dimensions. Halving the width removes about 75% of the pixels and typically 60–75% of the bytes, and it is far less damaging to how the image reads than collapsing the palette. Cutting duration is equally effective but changes what the GIF shows, so it is a content decision rather than a quality one.

Why did my GIF get larger after I compressed it?

The original almost certainly used delta frames — storing only the changed pixels per frame — and re-encoding writes full frames. Resizing forces that expansion. Enable frame merging to recover part of it; if the file still grows, the original was already close to the format's floor.

Does reducing colours really save much?

Less than resizing. 256 to 128 colours typically saves 20–35%, and is usually invisible. Going below 64 saves more but becomes visible on photos. On flat graphics, cutting to 16 or 32 colours is both smaller and visually clean.

Is there a lossless way to compress a GIF?

Only re-running the LZW encoder better than the original tool did, which rarely saves more than a few percent. GIF's compression is already lossless by definition — the lossy part is the palette, and there is no way to add colours back to make it smaller. For genuinely lossless animation, APNG or animated WebP are better formats.

How small can a GIF realistically get?

A 128×128, 20-frame, 32-colour emoji lands around 30–60 KB. A 480 px, 3-second, 128-colour social GIF lands around 800 KB–1.5 MB. Below these you are giving up something a viewer will notice.