Why a GIF is bigger than the video it came from
You take a four second clip that weighs 800 KB, turn it into a GIF, and end up with 14 MB. Nothing went wrong. GIF is a 1987 image format with no concept of modern video compression, so a GIF of a video is almost always larger than the video, often by a factor of ten or more.
Once you know which three things drive that number, you can get a usable GIF out of the same clip at a fraction of the size, or decide that a short muted video was the better answer all along.
What a GIF actually stores
A GIF is a stack of still images played in sequence. Each frame is stored with a palette of at most 256 colors and compressed with LZW, a general purpose scheme that predates the format’s use for animation.
Two consequences follow. First, color is thrown away: a photographic frame with thousands of shades is squeezed into 256 of them, which is where banding and dithering noise come from. Second, and more importantly for size, GIF has only a weak way to reuse information between frames. It can skip pixels that did not change from one frame to the next, and that helps for a cursor moving across a static screenshot, but it does nothing useful for a handheld shot where every pixel shifts slightly.
Why the video was so much smaller
H.264 and HEVC do exactly the thing GIF cannot. They store a full frame occasionally, then store the following frames as descriptions of motion: this block of pixels moved eleven pixels left, this region is unchanged, this part differs by a small amount. For normal footage, the vast majority of frames cost a tiny fraction of a full picture.
They also work in full color, in a color space tuned to how human vision actually works, and they discard detail selectively rather than quantizing the whole palette.
So the comparison is not GIF against video, it is a format that stores roughly 30 pictures per second against a format that stores one picture and 29 sets of instructions. The difference in the file listing is the difference in the approach. Remux versus re-encode covers how much video compression is doing behind the scenes.
The four dials that decide GIF size
In rough order of impact:
- Dimensions. Size scales with area, so halving the width and height cuts the pixel count to a quarter. A 1920 pixel wide GIF is almost never necessary; 480 to 640 pixels is normal for something posted in a chat or a document.
- Duration. Linear. Two seconds costs half of four seconds, and most GIFs contain a second of setup nobody needs.
- Frame rate. Also close to linear. Source footage at 30 or 60 fps rarely needs more than 12 to 15 fps as a GIF, and the result still reads as motion.
- Colors and dithering. A reduced palette with a good dither looks better and compresses worse; a flat palette compresses well and can band. This is the dial to touch last.
Cutting dimensions in half and frame rate in half together is roughly an eight times reduction, which turns that 14 MB into something under 2 MB before you have touched quality at all.
Making a smaller GIF on a Mac
If you are comfortable in the Terminal, the two-pass palette approach gives markedly better results than a straight conversion, because it builds a palette from the actual clip rather than a generic one:
ffmpeg -ss 2 -t 3 -i clip.mov -vf "fps=12,scale=540:-1:flags=lanczos,palettegen" palette.png
ffmpeg -ss 2 -t 3 -i clip.mov -i palette.png \
-lavfi "fps=12,scale=540:-1:flags=lanczos[x];[x][1:v]paletteuse" out.gif
-ss 2 -t 3 takes three seconds starting at the two second mark, which is usually the single biggest saving available. fps=12 and scale=540:-1 are the two dials above. Adjust those three numbers and re-run; each pass takes seconds on a short clip.
If you would rather not assemble commands, Manatee converts video to GIF on the Mac with GIF as one of its conversion targets, working from a duplicate so the source clip stays untouched. How to convert a video to GIF on a Mac walks through that path step by step.
Worth saying plainly: no tool makes GIF efficient. It is a format limit, not a software limit. What good tooling does is pick a sensible palette and spare you three rounds of trial and error.
When not to use GIF at all
This is the part most people skip, and it usually saves the most.
Almost everywhere a GIF is posted today, a muted looping MP4 works and looks better. Chat apps, documentation sites, issue trackers, social platforms and email clients with modern previews all handle short H.264 clips, and many of them convert your GIF into exactly that on upload anyway, which means you spent 14 MB to produce something the service will re-encode regardless.
Keep GIF when the destination genuinely needs an image file: a context that only accepts images, an old forum, a signature block, a README rendered somewhere that blocks video elements. Use a short MP4 for everything else. A three second 720p clip at a modest bitrate lands around 300 KB, in full color, with no banding.
If the clip is going somewhere with a hard upload ceiling, aiming at the number directly is easier than iterating on quality. How to shrink a video to a specific file size covers that, and Manatee does it by asking for a size in megabytes and finding the quality that fits.
If the GIF looks wrong as well as large
A few recognizable symptoms, each with a cause:
- Banded skies or gradients. The 256 color palette. Reduce dimensions instead of fighting it, or switch to video.
- Flickering or fizzing in flat areas. Dithering noise changing frame to frame, which also inflates the size because it defeats the skip-unchanged-pixels optimization.
- Motion that stutters unevenly. The source frame rate does not divide cleanly into the target. Try 15 fps from 30 fps footage, or 12 from 24.
- Colors visibly shifted. The palette was built from the wrong part of the clip. Generating a palette from the exact segment you are exporting, as in the commands above, fixes this.
Questions
Does converting a GIF to MP4 make it smaller? Yes, usually dramatically, though the color and detail already discarded by GIF do not come back. The result is a smaller file of the same degraded picture, which is still worth doing for a file you need to send.
Why is my screen recording GIF small but my camera GIF huge? A screen recording has large unchanged regions between frames, which is the one case GIF’s frame differencing handles well. Handheld camera footage changes every pixel of every frame, so nothing can be skipped.
Is there a size limit on a GIF? Not in the format, but most places that accept GIFs impose one, commonly a few megabytes, and some silently convert anything larger. Aim for under 2 MB and you will rarely be refused.
Does looping affect the file size? No. The loop is a flag in the file, not repeated frames. A GIF that loops forever is the same size as one that plays once.