GIF making guide

How to Reduce GIF File Size Without Making It Look Terrible

Why GIFs get so big and which fixes actually work: length, dimensions, frame rate, colors and dithering, with a worked example of how much each one saves.

By the Yodabi team · Updated · 7 min read

A GIF's size comes from three things: how many frames it has (length × frame rate), how many pixels each frame has (width × height) and how easy each frame is to compress (colors, noise and how much changes between frames). Cut them in that order. Shortening the clip and reducing its dimensions almost always save far more than fiddling with colors — and they hurt quality less.

Below we explain why GIFs get big in the first place, walk through each lever with a worked example and show how to hit a specific size limit.

Why GIFs are so much bigger than videos

GIF dates from the late 1980s, and its animation support is basic. Each frame is stored as an image of palette indexes: every pixel points to one of at most 256 colors in a color table. Those pixels are then compressed with LZW, a lossless method that works well on long runs of repeated pixels and poorly on noise.

What GIF lacks is the thing that makes modern video small: motion prediction. A video codec can say "this block moved three pixels to the left" and discard detail your eye will not miss. A GIF cannot. The best a GIF encoder can do is store only the rectangle that changed since the previous frame and mark unchanged pixels as transparent so the old ones show through.

That works brilliantly for screen recordings, where most of the screen sits still. It works badly for handheld camera footage, where almost every pixel changes in every frame. The same few seconds that make a small MP4 can make a GIF many times larger.

To get a feel for the raw numbers: a 480 × 270 frame has 129,600 pixels, one byte each before compression. Four seconds at 15 fps is 60 frames, or about 7.8 MB of pixel data for the encoder to squeeze. Everything below is about reducing that number, or making it easier to compress.

A worked example: what each change saves

Take a 4-second clip exported at 480 × 270 and 15 fps. The table shows how much pixel data each change leaves, compared with that starting point. File size does not track pixel data exactly, because compression depends on the content, but it moves in the same direction and usually by a similar proportion.

SettingsFramesPixel data left
480 × 270, 15 fps, 4 s (starting point)60100%
Trim to 3 s4575%
Lower to 10 fps4067%
Shrink to 320 × 1806044%
320 × 180 and 10 fps4030%
320 × 180, 10 fps, trimmed to 3 s3022%
For comparison: 640 × 360 at 24 fps, 4 s96284%

Two lessons stand out. First, dimensions are powerful because they work in two directions: going from 480 to 320 pixels wide cuts the width by a third, but the pixel count by more than half. Second, changes multiply: three moderate cuts together leave less than a quarter of the data, while each on its own would leave between 44% and 75%.

Lever 1: fewer frames

The number of frames is length multiplied by frame rate, so you can attack it from either side.

  • Trim hard. Cut everything before the action starts and after it lands. A reaction GIF rarely needs more than two or three seconds.
  • Lower the frame rate. 10–15 fps looks fine for most clips. Going from 24 to 12 fps halves the frames. Our guide to GIF frame rate and speed explains how low you can go before motion looks choppy.
  • Watch your loop mode. A boomerang plays the clip forward and then backward, which doubles the frame count. If size is tight, trim the clip to half the length before choosing Boomerang.

Lever 2: fewer pixels per frame

  • Match the width to where it will be seen. Chat bubbles and phone-width columns rarely show a GIF wider than a few hundred pixels. Around 320 px suits chats; 480 px suits most web pages.
  • Crop away dead space. If the action happens in the middle of a wide shot, cropping removes pixels without making the subject any smaller on screen.
  • Avoid letterbox bars where you can. Bars are cheap to store because they never change, but they make the subject smaller for no benefit. Cropping to the target shape is usually better than padding.

Lever 3: colors and dithering

Every GIF frame is limited to 256 colors, so real-world footage always has to be reduced to a palette. Encoders hide the missing shades with dithering: scattering pixels of nearby colors so that, from a distance, they average out to the shade that is not in the palette.

  • Error-diffusion dithering (methods such as Floyd–Steinberg or Sierra) gives the smoothest gradients, but its scattered pixel pattern changes from frame to frame. That can shimmer, and it compresses poorly.
  • Ordered dithering (Bayer) uses a fixed grid pattern. It looks more textured, but because the pattern is stable, it compresses better and shimmers less.
  • Fewer colors (128 or 64 instead of 256) mean smaller numbers for the compressor to handle and more repetition, at the cost of banding in skies, skin and shadows.

Color reduction typically saves less than trimming or resizing, and the quality loss is more visible. Use it last, mainly for content with few colors to begin with: cartoons, interfaces, text and logos.

Content matters as much as settings. Film grain, camera shake, falling rain, rustling leaves and confetti change many pixels in every frame and defeat compression. A steady shot of a subject against a plain background can be a fraction of the size of a shaky one at identical settings.

How to hit a specific size limit

Many chat apps, forums and websites limit GIF uploads. Limits differ from service to service and change over time, so check the current number where you plan to post. Then work through the levers in this order until you are under it:

  1. Trim to the essential moment.
  2. Crop to the subject.
  3. Reduce the width (480 → 400 → 320 px).
  4. Lower the frame rate (15 → 12 → 10 fps).
  5. Reduce colors (256 → 128 → 64) only if you still need to.

If you are using GifLab, you can skip the trial and error. In the editor's Export settings, choose Target file size and pick 1, 2, 5 or 10 MB, or enter a custom limit between 0.1 and 100 MB. GifLab exports at up to 640 pixels on the long edge and, if the result is over your limit, tries progressively smaller versions — lowering resolution, color count (256, 128 or 64) and, for video, frame rate towards 10 fps — keeping the best one that fits. Your trim, edits and playback speed stay the same. For GIFs built from photos or in the Frame Editor, it keeps every frame and its timing and only adjusts resolution and colors.

If even the smallest version cannot fit, GifLab tells you rather than handing you an unwatchable file. At that point the fix is a shorter clip or a higher limit. After export, the result shows the final size, dimensions, frame rate and color count, so you can see what was traded away.

Prefer full control? Choose Manual quality and set Frame rate, Canvas (Standard is 480 px wide, Small is 320 px wide) and Quality yourself. High uses 256 colors with error-diffusion dithering; Medium and Low use 128 and 64 colors with ordered dithering.

Shrinking a GIF you already have

You do not need the original video to make a GIF smaller. In GifLab, open the file with Edit a GIF, trim it if you can, choose Target file size and export again. Re-encoding cannot bring back detail that was already lost, so start from the best copy you have and do it once rather than repeatedly.

When a video is the better answer

If the place you are posting accepts short MP4 videos that autoplay and loop, a video will usually look better at a fraction of the size, because it uses motion prediction and millions of colors. Some sites even convert uploaded GIFs to video behind the scenes. GIF is still the right choice where you need universal, silent, auto-looping playback: email, documentation, issue trackers, older forums and many chat apps.

Frequently asked questions

Can I compress a GIF without losing any quality?

Only a little. Lossless optimization (better LZW packing, storing only changed areas) is something good encoders already do. Meaningful savings always cost something: frames, pixels or colors. The trick is choosing the loss viewers notice least.

Why did my GIF get bigger after I added a filter or caption?

Effects that add gradients, grain or vignettes give the compressor more to deal with. A caption on a solid background usually adds relatively little, because flat color compresses well and the caption does not change between frames.

Is a lower frame rate or a smaller size better?

For most clips, reduce the size first down to the width where the GIF will actually be displayed, then lower the frame rate. Pixels shown at a smaller size than the file are simply wasted, while frame-rate cuts can make motion look jerky.