Skip to content
Optimisation

Reduce GIF File Size Without Wrecking the Picture

Four levers control GIF file size, and they are not equally powerful. Ranked by effect: dimensions, frame count, colour count, dithering. Understanding why they rank that way is what lets you cut 70% without the result looking cut.

12 September 2026 · 8 min read

Why GIFs get large in the first place

GIF compresses with LZW, scanning each row for repeated byte sequences and replacing them with shorter codes. It works brilliantly on flat colour and poorly on noise, and — this is the important part — it has no concept of motion. Every frame is compressed on its own terms.

Modern video codecs do the opposite: they store one full frame and then describe how the following frames differ from it. That is why a video of a mostly static screen recording is tiny and the same recording as a GIF is not. GIF does support skipping unchanged regions between frames, but it is a much weaker mechanism than motion compensation, and any noise, dithering or camera movement defeats it.

Lever one: dimensions

File size scales with pixel count, which scales with the square of the linear dimension. Going from 640 px wide to 480 px removes about 44% of the pixels before any encoder setting is touched. Going to 320 px removes 75%.

This is almost always the first thing to try, because a GIF is nearly always displayed smaller than it was authored — inside a chat window, a documentation page, a ticket. Exporting at the size it will actually be shown costs nothing visually and is the cheapest large win available.

Lever two: frame count

Bytes scale almost linearly with frames, so halving the frame rate roughly halves the file. Trimming dead time at the start and end is even better, because those frames contribute nothing at all.

Watch your clip and count how many frames are actually load-bearing. A demo that takes eight seconds usually has two seconds of someone finding the cursor at the start and a second of nothing at the end. Cutting those is free.

Trim before extracting frames, not after. Decoding a range you are about to throw away costs time and memory for nothing.

Lever three: colour count

Less linear than people expect. Dropping 256 to 128 colours is often visually free and saves 20–30%. Dropping 32 to 16 usually looks obviously worse for a much smaller absolute gain, because by then the palette is no longer the dominant cost.

Material matters more than the number. Anything with large flat areas tolerates aggressive reduction; anything with gradients — skies, skin, shadows, soft shadows behind text — falls apart quickly and needs dithering to stay acceptable.

MaterialColoursDithering
Screen recording, UI32–64Off
Flat illustration, logos16–32Off
Live-action video128Floyd–Steinberg
Photo slideshow128–256Floyd–Steinberg
Text-heavy framesKeep highOff — shrink instead
Where to start, by material

Lever four: dithering, which can backfire

Dithering approximates missing colours by mixing available ones into a fine pattern. It removes banding, and it makes flat regions noisy — which is exactly what LZW compresses worst. On the wrong material it grows the file while making it look busier.

Ordered (Bayer) dithering uses a fixed pattern, so it repeats and compresses better than the error-diffused alternative. Floyd–Steinberg looks smoother on photographs but produces non-repeating noise. On flat graphics, no dithering at all is both smaller and cleaner.

A worked order of operations

Given a 4 MB GIF that needs to be under 1 MB, work down the list rather than reaching for a single "compress" slider.

  • Trim dead frames at both ends. Typically 10–20% off, free.
  • Halve the frame rate, 25 fps to 12.5 fps. Roughly half the remaining size.
  • Reduce the width by a third, 720 px to 480 px. Roughly 55% of what is left.
  • Only now touch colours: 256 to 128, then 64 if the material is flat.
  • Re-check the estimate after each step and stop as soon as you are under budget.

Those four steps compound to well under a quarter of the original. The reason to do them in order is that each one reduces the cost of the next, and the visually expensive lever is last.

When the answer is a different format

If you have trimmed, halved and shrunk and it is still too big, the material is telling you something. Long clips, camera movement and photographic gradients are all things GIF is structurally bad at.

MP4 and WebM handle exactly those cases an order of magnitude better, and almost every destination now accepts them. Reach for GIF when inline autoplay with no player is a hard requirement, and for video when it is not.

Try it in the editor

Everything described here runs in your browser, on your machine.

All guides