GIF

What is a GIF file?

Limited to 256 colours, but the only image format everything animates. Large files for video-like content.

What GIF is

GIF is a binary format, meaningful only to a program that knows it. It stores a grid of pixels, so enlarging it past its own resolution softens it. It is used for the web.

The extension is .gif, and the full name is Graphics Interchange Format. Both matter less than what the file can hold, which is what the rest of this page is about.

Where GIF came from

CompuServe published it in 1987. The specification is GIF89a.

A format that has been readable for that long is a format worth trusting with something you want back in ten years.

The specification is public

Anyone can implement it without asking permission or paying a licence, which is why it turns up in so many programs and why files written twenty years ago still open.

It is a legacy format

It still opens everywhere and is still written by older tools, but nothing new is being built around it. Convert what you mean to keep, and do not choose it for something starting today.

Nothing is thrown away

GIF stores its content exactly. Saving it again changes nothing, so it can be opened, edited and re-saved as often as you like without accumulating damage — which is what makes it a working format rather than a delivery one.

It can be transparent

GIF carries an alpha channel, so a logo keeps its soft edges over whatever sits behind it instead of arriving in a white box.

It can hold more than one frame

GIF can store an animation rather than a single still. That is worth knowing before converting one: a target that holds one frame keeps the first and drops the rest, usually without saying so.

Colour it can describe

Up to 8 bits per channel. It can work in an indexed palette.

Eight bits per channel is what a screen shows and what nearly every delivery format carries.

GIF is limited to 256 colours

The palette is the constraint everything else follows from. A photograph converted into it has to have its colours chosen and approximated, which is why gradients come out in bands or speckles, and why flat-coloured artwork survives it perfectly.

There is a size limit worth knowing

GIF cannot describe an image larger than 65,535 pixels on a side. That is far beyond an ordinary photograph and well within reach of a stitched panorama or a high-resolution scan, which is exactly when people meet it.

What opens GIF

GIMP, Adobe Photoshop and ImageMagick read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

Every current browser reads it.

That makes it a safe thing to put on a page or attach to a message without wondering what the other end has installed.

It is a delivery format

GIF is meant to be handed over rather than worked in. Editing one is possible and rarely pleasant; the sane approach is to change the source and export again.

What goes wrong with it

The recurring complaints: smooth gradients can come out in visible steps.

None of these is a reason to avoid the format. They are the things worth knowing before you are surprised by one, which is a different claim and a more useful one.

The facts, in one place

Identifiers and provenance for the GIF format.
Extension.gif
Media typeimage/gif
Published byCompuServe
First published1987
SpecificationGIF89a

Converting GIF to something else

Converting something else to GIF

Formats worth considering instead of GIF

Where these figures come from

The claims on this page are checkable, and these are the documents that settle them.