File format

GIF - Graphics Interchange Format

GIF is an old lossless image format limited to 256 colours per frame, and still the simplest way to store a short silent animation that plays anywhere an image can.

GIF, the Graphics Interchange Format, was created by the online service CompuServe in the late 1980s so that pictures could travel down slow dial-up connections and appear on machines that disagreed about almost everything else. Its second and final revision added transparency and multiple frames, and that is the version still in use. Decades later GIF survives for one reason: it is the simplest way to put a short, silent, looping animation somewhere that expects a plain image.

How a GIF stores its picture

A GIF is lossless but heavily limited. Its compression, called LZW, replaces repeated runs of pixels with short codes and gives back exactly what went in. The limit is colour: each frame may use at most 256 colours, chosen from a palette stored in the file. A photograph has far more shades than that, so saving one as a GIF forces the encoder to pick 256 and approximate the rest, usually by dithering: scattering dots of two colours to imitate a third. That is why photographic GIFs look speckled and banded.

Transparency is all or nothing. One entry in the palette can be marked transparent, so a pixel is either completely see-through or completely solid. There is no way to make a soft, half-transparent edge, which is why GIF logos often show a hard fringe against an unexpected background.

Animation is simply several images stored one after another, each with its own palette, its own delay measured in hundredths of a second, and a disposal instruction saying what to do with the frame before it. A small extra block tells the viewer how many times to loop. There is no sound.

What metadata a GIF carries

This is the short section, and the answer is genuinely unusual: a GIF carries almost no metadata at all. Metadata is the descriptive information a file keeps about itself, and GIF has hardly any room for it. There is no field for camera settings, no author, no date, no title and nowhere to store GPS coordinates. Neither EXIF nor IPTC, the standards that carry that information in photographs, was ever defined for GIF.

What a report can show you is mostly structure rather than history:

  • Image dimensions, the size of the colour table and how many colours are actually used.
  • The frame count, each frame's delay and disposal method, and the loop count.
  • Which palette entry, if any, is the transparent one.
  • Whether the image is interlaced, an old trick that let a rough version appear before the file had finished loading.
  • Comment blocks. GIF does allow free-form text comments, and software sometimes writes its own name, a copyright line or a source address into one. This is the only place a name is likely to turn up.
  • Application blocks. Beyond the one used for looping, Adobe defined a block that can carry a complete XMP metadata packet inside a GIF. It is rare, but it is why a report can show XMP in a GIF.

This cuts both ways. A GIF is unlikely to leak your location or your camera's serial number, because it has nowhere to put them. That is not anonymity, though: an animation made from a photo or a video still shows whatever the pixels show, and any comment block stays in the file until somebody removes it.

When to use GIF

Use a GIF for a short looping animation that has to work as an ordinary image, in a chat window, a forum post or an email. For a still picture there is no good reason left to choose it: PNG is smaller for the same flat graphics and keeps full colour, and JPG is far smaller for photographs.

For animation the honest comparison is with video. An MP4 or WebM clip of the same few seconds is usually a fraction of the size and has smooth colour. WebP and APNG also animate with full colour and proper transparency. GIF's advantage is not quality and not size; it is that everything, everywhere, already accepts it.