abox.tools

Language: English

How to turn a video into a GIF

A GIF is a format from 1987 that stores whole pictures rather than motion, so one made from a video is always big. This is which of the three settings to move when it is too big, and how much each one buys you.

Open the Video to GIF Pick the section, the size, and the frame rate.

View as Markdown

The short answer

Open the Video to GIF converter, drop the clip in, mark the seconds you want, and leave the width at 480 and the rate at 12 frames a second. That is the setting most GIFs want. If the file comes out too big, take the width down before you touch anything else — it is the setting that pays twice.

The rest of this page is about why, because “my GIF is 14 MB” is the problem everybody actually has, and which knob to turn is not obvious.

Why a GIF of a video is so enormous

A video codec stores motion. It writes one full picture every couple of seconds and then, for every frame in between, a description of how that picture moved: this block of pixels slid four to the left, this area got slightly darker. A five-second clip can be a few hundred kilobytes because most of it is instructions about a picture you already have.

GIF has none of that. It was finished in 1989, before any of it existed. Every frame is a picture, compressed on its own with a scheme designed for screenshots of a spreadsheet. There is no motion estimation anywhere in the format and no way to add one.

So the number to expect is ten times the size of the video, and no converter can talk you out of it. What a good one can do is not waste anything on top of that, and give you the three settings that actually decide it.

The section card: a frame of video with a timecode on it, and a bar showing a four-second piece marked out of a twenty-second clip.
The section first, because every setting below is multiplied by how many seconds you kept.

The three settings, and what each one costs

Everything about a GIF's size comes down to how many pixels it contains, which is the length times the rate times the area of one frame.

A worked example. Six seconds of a phone clip at its own ⁦1080×1920⁩ and 30 fps is 180 frames of two million pixels: about 350 million pixels, which is not a GIF, it is a hostage situation. The same six seconds at 480 wide and 12 fps is 72 frames of 400,000 pixels — 30 million, about a twelfth — and it looks like what people mean by a GIF.

The export card: a width of 480, a frame rate, a dithering choice, and a summary estimating the frames and the size.
Three settings and an estimate that moves as you change them. Which one to spend first is what this section is about.

Which frame rate to pick

Twelve is the default here and the right answer surprisingly often. It is the rate hand-drawn animation has used for a century: fast enough that the eye reads it as continuous movement, slow enough that you are not paying for frames nobody can see.

There is a hard ceiling you may as well know about: GIF stores how long each frame stays on screen in hundredths of a second, and every browser treats a delay under two hundredths as ten. So 50 frames a second is the real maximum, and a file asking for 100 will silently play at 10. A converter offering you 60 fps is either ignoring that or about to surprise you.

256 colours, and what dithering is for

The other half of the format's age: a GIF carries one table of at most 256 colours, and every pixel is a number pointing into it. A video frame has up to sixteen million. Almost all of that gets thrown away, and how it is thrown away is most of what a GIF looks like.

A good converter counts the colours in your clip and picks 256 that suit it, rather than using a fixed set. A shot of a forest gets 256 greens; a shot of a sunset gets 256 oranges. That is what the tool here does, across every frame of the section rather than only the first, so a colour that only appears at the end still gets a place.

Dithering is what happens where the colour you need is still missing. Instead of rounding a whole area to the nearest available colour — which turns a smooth sky into four flat bands with visible steps between them — it alternates the two nearest colours in a fine pattern, and from a normal viewing distance your eye mixes them into the one that is not there.

One detail worth knowing if you compare converters. The obvious way to dither — error diffusion, which most image editors use — makes each pixel's result depend on the pixels around it. In an animation that means a background that is not moving still dithers differently in every frame, so it visibly crawls, and every frame has to be stored in full because every pixel technically changed. The alternative, an ordered dither, depends only on where a pixel is, so a still background stays perfectly still. That is what this tool uses, and it is why its files are smaller as well as calmer.

When not to make a GIF at all

Worth asking, because the honest answer is often “don't”. A silent, looping MP4 or WebM is around a tenth of the size of the same animation as a GIF, plays the same way, and is what every social platform converts your GIF into after you upload it anyway.

Keep the GIF where the destination genuinely needs one:

Where the sound matters, the question answers itself: GIF has never had audio and never will. Cut the video instead — the Video Cutter takes a section out without re-encoding a frame of it.

Getting under a size limit

Most of the reason anyone tunes a GIF is a limit at the far end. In rough order of how much they bite:

The order to try, when you are over: shorten the section, then halve the width, then drop the rate, then turn dithering off. The first two are worth more than the last two put together.

None of this needs an upload

Converting a video to a GIF is decoding, resizing, counting colours and compressing — four things a browser has been able to do on its own for years. The tool linked at the top does all of it on your machine: the file is read off your disk, the frames are decoded by your browser, and the GIF is assembled in memory and handed to your downloads.

That is worth caring about here more than usual. The clips people turn into GIFs are personal ones — a moment from a family video, a screen recording of something at work, a few seconds of a call. A converter that wants those uploaded is asking for a copy of them, and there is no technical reason left to say yes.