How to make a GIF, and what we learned making 18 of them from one clip

October 23, 20269 min readBy the FreeImageTools teamMeasured and sourced
Four frames from a NASA spacewalk preparation clip beside bars comparing the size of the same 5 seconds as a GIF, animated WebP and MP4

Making a GIF takes a minute. Making one that is not ten megabytes takes knowing which setting actually matters. So we took a single 5 second clip, made 18 GIFs from it while changing one thing at a time, and saved the same clip as an animated WebP and an MP4 to see what the 1980s format really costs.

The answer is that width and frame rate decide almost everything, colours matter much less than people think, and the way a GIF is written can make it a third of the size without changing how it looks.

THE SHORT ANSWER
How do I make a GIF?
Add photos or a short video to a GIF maker, set the time per frame and the width, and export. Our GIF maker does it in the browser.
What size should it be?
480 pixels wide at 10 frames per second suits most clips. Our 5 second test came out at 1.90 MB.
What makes a GIF big?
Width and frame count. Colours and dithering change the size by a few percent to a third.
Is MP4 better?
Much smaller, 7.4 times in our test. Use GIF only where video will not play or autoplay.
GIFS BY THE NUMBERS
53%
smaller when the GIF went from 480 to 320 pixels wide
+70%
bigger at 24 frames per second than at 10, against +24% for the MP4
63%
saved by storing only the part of each frame that changed
7.4×
the size of the same clip as an MP4 video

How we tested it

The clip is 5 seconds from NASA's public domain video Suiting Up for a Spacewalk (Johnson Space Center, 2019), starting at 0:14. It is a fixed camera inside the space station with astronauts moving around two spacesuits and captions changing on screen, which is typical of the clips people turn into GIFs: some movement, a lot of still background, some text.

Every GIF was made with the encoder our GIF maker uses, run in Node.js on the exact frames ffmpeg extracted, so the numbers are what the tool produces. For comparison, ffmpeg 6.1 saved the same frames as an animated WebP (libwebp, quality 75) and an MP4 (x264, CRF 23). We changed one setting at a time from a baseline of 480 pixels wide, 10 frames per second and 256 colours with dithering.

Width matters most

WidthGIFAnimated WebPMP4
320 × 180919 KB478 KB139 KB
480 × 2701.90 MB857 KB264 KB
640 × 3603.22 MB1.16 MB409 KB
800 × 4504.90 MB1.65 MB583 KB

A GIF grows with the area of the picture. 640 pixels wide has 78 percent more pixels than 480, and the GIF grew 70 percent. Going down to 320 pixels cut it by more than half. Most places a GIF ends up, a chat, a forum post, a slide, show it at well under 480 pixels anyway, so 320 to 480 is rarely a visible loss.

The gap to the modern formats widens as the picture grows. At 320 pixels the GIF was 1.9 times the WebP; at 800 pixels it was 3 times. Against the MP4 it went from 6.6 to 8.6 times.

Frame rate is the second lever

Frame rateFramesGIFMP4
5 fps251.23 MB212 KB
10 fps501.90 MB264 KB
15 fps752.46 MB293 KB
24 fps1203.23 MB326 KB

Here the formats part ways. Video codecs predict each frame from the previous one, so extra frames in between cost little: the MP4 grew 24 percent from 10 to 24 frames per second. A GIF has no prediction, so it grew 70 percent. That is why GIFs from screen recorders at 30 or 60 frames per second balloon, and why 10 to 15 frames per second is the sweet spot for most clips.

Below 0.02 seconds, browsers slow your GIF down

A GIF stores each frame's time in hundredths of a second, and browsers treat 0.01 seconds or less as 0.1 seconds, so a GIF exported at 100 frames per second plays at 10. Frames of 0.02 seconds (50 fps) are the fastest that play as written.

Colours and dithering matter less than you think

ColoursSize, ditheredSize, no ditheringFidelity, dithered / not
2561.90 MB1.83 MB33.5 / 34.3 dB
1281.66 MB1.60 MB32.9 / 34.3 dB
641.42 MB1.37 MB30.6 / 32.0 dB
321.18 MB1.15 MB28.2 / 29.5 dB

Each frame of a GIF can use at most 256 colours, and many tools offer fewer to save space. Halving the colours saved 13 to 17 percent each time; going all the way from 256 to 32 colours saved 38 percent, while the picture got visibly grainier. Width and frame rate are far better places to look for savings.

The fidelity column compares every frame with the original video, where higher is closer. Dithering scores lower because it deliberately adds a fine pattern of dots, but that pattern is what keeps a sky or a cheek from breaking into visible bands of colour. Keep it on for photos and video. For screenshots, logos and flat graphics, where there are no gradients to rescue, turn it off.

The trick that makes a GIF a third of the size

The format has one way to avoid repeating itself: a frame can cover only part of the picture, and any of its pixels can be transparent so the frame below shows through. An encoder that uses this stores only what moved. The simplest encoders do not, and write every frame in full.

How the GIF was writtenSizeFidelity
Every frame in full5.14 MB32.9 dB
ffmpeg, optimised palette and changed rectangles2.97 MB34.6 dB
Our encoder, changed rectangle plus transparency1.90 MB33.5 dB

On our clip, storing only the changes cut the GIF by 63 percent, from 5.14 MB to 1.90 MB, and it came out 36 percent smaller than ffmpeg's optimised output, at a fidelity about 1 dB lower. The saving depends on the footage: a fixed camera, a screen recording or a person talking in front of a wall saves the most. A panning camera, a handheld phone, or a slideshow with fades changes every pixel in every frame and saves almost nothing.

How to make a GIF, step by step

From photos

  1. Open the GIF maker and drop in your photos, or paste them.
  2. Drag the frames into order and set the time per frame: 0.5 to 1 second suits a slideshow.
  3. Pick a shape. If the photos differ, Fit whole frame keeps each one complete; Fill and crop fills the frame and trims edges.
  4. Turn on Short fade for a smoother slideshow, choose how it loops, and press Make GIF.

From a video

  1. Choose the video. MP4 files with H.264 video open in every current browser.
  2. Drag the start and end sliders around the moment you want. Two to four seconds is usually enough.
  3. Pick 10 frames per second, press Use this clip, and set the width to 480 pixels.
  4. Make the GIF and check the size. If it is too big, try 320 pixels or 8 frames per second before reducing colours.

From your screen

Record the screen with the recorder built into your system, which saves a video file, then make the GIF from that video. Screen recordings compress very well as GIFs because most of the screen stays still. Switch dithering off for them, since text and flat colours have no gradients to smooth.

Settings for common GIFs

What you are makingWidthSpeedColours
Reaction or meme clip320 to 480 px10 fps256, dithered
Product or feature demo480 to 640 px10 to 12 fps128 to 256
Screen recording or tutorial640 to 800 px8 to 10 fps64 to 128, no dithering
Photo slideshow480 to 800 px0.5 to 1 s per photo256, dithered, short fade
Animated email header600 px, the usual email width8 to 10 fps, few frames64 to 128

GIF, WebP or MP4?

GIF dates from 1987 and its animation features from the GIF89a revision in 1989. It is still everywhere because almost everything can show it: browsers, email, forums, chat apps, documents, and places that refuse video or will not autoplay it. That is the only reason to choose it.

Animated WebP plays in every major current browser and was under half the size of the GIF in our test, with full colour instead of 256. An MP4 was 7.4 times smaller still and smoother, because video codecs predict motion. If you control the page, a short muted, looping MP4 is the better choice; if you are posting somewhere that only accepts images, make the GIF and keep it small.

Make one now

The GIF maker runs in your browser with the same encoder we tested here, so the photos and videos you use never leave your device. There are four Apollo photos built in if you want to try it first.

Open GIF MakerResize Image

The bottom line

To make a GIF that people will actually load, keep it narrow and keep the frame rate down: 480 pixels at 10 frames per second gave us a smooth 5 second clip under 2 MB. Reach for fewer colours only to trim the last few percent. And if the place you are posting accepts video, an MP4 of the same clip will be a fraction of the size.

Frequently asked questions

How do I make a GIF?+
Open a GIF maker, add photos or a short video, set the time per frame, the width and the loop, and export. Ours runs in the browser with nothing uploaded. For a video clip, 480 pixels wide at 10 frames per second is a good place to start.
Why are GIFs so big?+
A GIF stores every frame as a separate picture with at most 256 colours, compressed with a method from the 1980s that cannot predict one frame from the last. In our test the same 5 seconds was 1.90 MB as a GIF, 857 KB as an animated WebP and 264 KB as an MP4.
What frame rate should a GIF be?+
10 to 15 frames per second for video. Size grows almost in step with the frame count: our clip went from 1.90 MB at 10 fps to 3.23 MB at 24 fps. For a photo slideshow, use 0.5 to 1 second per frame instead.
How do I make a GIF smaller?+
In order of effect: make it narrower, lower the frame rate, shorten it, then reduce the colours. Going from 480 to 320 pixels wide cut our GIF by 53 percent; halving the colours saved only 13 to 17 percent each time.
Is GIF or MP4 better?+
MP4 is far smaller and looks better, 7.4 times smaller in our test, so use it wherever video plays. GIF still wins where video does not play or does not autoplay, such as many forums, chat apps and email.
Does dithering make a GIF bigger?+
A little. Turning dithering off saved 3 to 4 percent in our test. Dithering hides banding in gradients like skies and skin, so keep it for photos and switch it off for screenshots and flat graphics.
What is the maximum length of a GIF?+
The format has no real limit, but every second adds size. At 480 pixels and 10 frames per second our clip cost about 0.4 MB per second, so 10 seconds would be close to 4 MB.

Sources and method

Clip: 5.0 seconds from 0:14 of NASA's "Suiting Up for a Spacewalk", 1280 × 720 at 30 fps, scaled with Lanczos and resampled to the frame rate under test by ffmpeg 6.1. GIFs: the FreeImageTools encoder (median cut palette per frame, Floyd-Steinberg dithering, changed rectangle with transparency, tolerance 4 levels per channel) compiled to Node.js. WebP: libwebp_anim at quality 75. MP4: libx264 at CRF 23, preset medium, no audio. ffmpeg GIF: palettegen with stats_mode=diff and paletteuse with diff_mode=rectangle. Fidelity is mean PSNR over all 50 frames, decoded with Pillow 12.3, against the scaled source frames. Sizes are in units of 1,024.

  1. NASA Image and Video Library, Suiting Up for a Spacewalk
  2. Graphics Interchange Format, Version 89a (W3C copy of the specification)
  3. GIF, Wikipedia
  4. WebP, Google for Developers
  5. ffmpeg filters documentation, palettegen and paletteuse
  6. Floyd-Steinberg dithering, Wikipedia
CITE THIS ARTICLE

In a test on a 5 second NASA clip at 480 × 270 and 10 frames per second, a GIF was 1.90 MB, 2.3 times an animated WebP and 7.4 times an MP4; raising the frame rate to 24 grew the GIF by 70 percent but the MP4 by 24 percent, and storing only changed areas cut the GIF by 63 percent. FreeImageTools, "How to Make a GIF: Size, Frame Rate and Colours Tested", October 23, 2026, https://freeimagetools.org/blog/how-to-make-a-gif

Keep reading