Why is my GIF so big? How to make a GIF smaller without it looking awful
You made a five-second clip and the GIF came out at 12 MB, bigger than the video it came from. Here's why, and what actually shrinks it.
What makes a GIF big
The file size is roughly width × height × number of frames × how hard each frame is to squeeze. The first three you choose. The last one depends on what's in the picture:
| What's in it | How well it squeezes | Typical 5 s GIF at 480 px, 10 fps |
|---|---|---|
| Screen recording, UI demo, terminal | Very well: big flat areas, and most of the screen doesn't change | ~150 to 400 KB |
| Cartoon, sticker, simple animation | Fairly well: bold shapes, but more of the frame moves | ~1 to 2.5 MB |
| Camera footage, film or TV clip | Badly: sensor grain and fine detail defeat LZW, and the whole frame moves | ~3 to 8 MB |
These are rough figures; lighting, camera shake and how busy the background is can move them a lot.
What to change, in order
| Change | Typical saving | Cost |
|---|---|---|
| Width 640 → 480 px | ~45% | Slightly softer; most people view GIFs small anyway |
| Width 480 → 320 px | ~55% | Small text becomes hard to read |
| 15 → 10 fps | ~33% | Motion a bit choppier; fine for most reactions and demos |
| Trim 6 s → 4 s | ~33% | Shorter loop |
| Dithering off | ~10 to 25% | Visible bands in skies, skin and gradients |
| 256 → 64 colours | ~15 to 25% | Banding and colour shifts, worse on photos |
gifsicle --lossy=80 | ~30 to 50% | Light grain or streaks |
Width wins because it counts twice: a narrower GIF is also shorter, so the pixel count falls with the square. That's why the fit-a-limit finder tries narrower widths before it drops colours.
Make a good, small GIF with ffmpeg
A one-line ffmpeg -i clip.mp4 out.gif uses a generic palette, so it looks blotchy and is often bigger than it needs to be. The two-step palette method builds the best colours for your clip first:
ffmpeg -y -t 5 -i input.mp4 -vf "fps=10,scale=480:-2:flags=lanczos,palettegen=max_colors=128:stats_mode=diff" palette.png ffmpeg -y -t 5 -i input.mp4 -i palette.png -lavfi "fps=10,scale=480:-2:flags=lanczos [x]; [x][1:v] paletteuse=dither=sierra2_4a:diff_mode=rectangle" output.gif
fps=10andscale=480:-2set the frame rate and width;-2keeps the shape. Add-ss 12before-tto start 12 seconds in.stats_mode=diffbuilds the palette from the parts that move, which suits screen recordings; usefullfor camera footage.dither=nonemakes the file smaller but shows bands;sierra2_4ais a good middle ground.diff_mode=rectangleonly redraws the changed area of each frame.
Then squeeze it further with gifsicle (version 1.92 or newer): gifsicle -O3 --lossy=80 output.gif -o output-small.gif. Higher --lossy numbers mean smaller and grainier. The calculator writes all of this with your settings.
When not to use a GIF at all
If the place you're posting accepts video, a muted looping MP4 is usually 10 to 30 times smaller and looks sharper, because video formats only store what moves between frames. Many sites that show "GIFs" already convert them to video behind the scenes. See GIF vs MP4 vs WebP for which to pick, and the compress-a-video-to-a-size guide to hit an exact limit with an MP4.
Still too big?
- Crop instead of shrinking: if only part of the screen matters, crop to it with
crop=w:h:x:ybeforescale. - Hold still: camera shake makes every pixel change every frame. A tripod or stabilised clip can halve the size.
- Cut the loop: a 2 second loop that repeats seamlessly often reads better than 6 seconds anyway.
- Check the limit's units: some sites count 1 MB as 1,048,576 bytes, others as 1,000,000. Leave 5% to spare.
Related
Keyframes: why MP4 is so much smaller
Questions
Why is my GIF bigger than the original video?
Video formats only store what changes between frames and use far better compression. A GIF stores nearly every frame whole with LZW from 1984, so it's often 10 to 30 times bigger than the MP4 it came from.
What's the fastest way to make a GIF smaller?
Make it narrower. Going from 640 to 480 pixels wide cuts the size by about 45%, because the height shrinks too. Then lower the frame rate to 10 to 12 fps and trim the length.
Does reducing colours shrink a GIF much?
A little. Going from 256 to 64 colours usually saves 15 to 25% and adds banding, so change width, frame rate and length first.
What does gifsicle --lossy do?
It lets the LZW compressor accept slightly wrong pixels when that makes a longer match, which shrinks the file by roughly 30 to 50% at --lossy=80 with light grain.
How do I get a GIF under 10 MB?
For camera footage, try 480 pixels wide at 10 to 12 fps and keep it under about 6 seconds. Screen recordings fit much longer. The GIF size calculator finds settings for any limit.
Published .