What Is a GIF?

The format that refuses to die: 256 colours, looping animation, and a place in internet culture long after better formats arrived.

Flat vector illustration in deep navy blue of a cozy living room at night: a pair of hands holds a smartphone showing a simple looping animation of a rounded shape, lit by a warm sunset-orange floor lamp, with a wall-mounted screen, a coffee table with a mug and remote, a plant, and a night sky through the window.

A GIF is a raster image format from 1987 that stores a limited palette of up to 256 colours and can hold several frames, so it can animate. Its compression is lossless, but that 256-colour ceiling is the defining limit: GIF is excellent for simple flat-colour graphics and short looping animations, and poor at photographs, which need far more colours than it can hold.

GIF stands for Graphics Interchange Format. CompuServe introduced it in 1987, which makes it one of the oldest image formats still in everyday use - and it survives more for cultural reasons than technical ones.

256 colours, and why that matters

The single fact that explains almost everything about GIF: each GIF uses a palette of at most 256 colours. For a logo, an icon, or a cartoon with a handful of flat colours, that is plenty, and the file stays small. For a photograph, which contains thousands of subtle shades, 256 colours is nowhere near enough - the result shows visible banding, or the encoder fakes the missing colours with dithering, a pattern of dots that approximates a shade it cannot store. Either way a photo looks worse as a GIF than as a JPG, and the file is often larger too.

It is lossless - within that limit

GIF's compression itself does not throw away detail the way JPG does; it is lossless once the image is inside the 256-colour palette. The loss happens earlier, when a full-colour image is reduced to 256 colours to become a GIF at all. So a graphic that already has few colours converts to GIF perfectly, while a photo loses most of its colour on the way in - and none afterwards.

Animation and transparency

Two features kept GIF alive. It can store multiple frames and play them as a loop, which is why reaction clips and simple animations are GIFs. And it supports transparency, but only one bit of it: a pixel is either fully transparent or fully opaque, with no partial levels. That is why a GIF with a soft, feathered edge shows a hard, jagged fringe instead - there is no smooth alpha channel like PNG and WebP have.

What to use instead

For almost every job, something beats GIF now:

  • Static graphics - PNG. Same lossless quality, no 256-colour cap, real transparency. If you have a still GIF, GIF to PNG converts it, and how to convert GIF to PNG covers the details.
  • Animation - a real video (MP4 or WebM) or an animated WebP is dramatically smaller and smoother than an animated GIF of the same length. GIF animations are heavy for what they are.
  • Photos - never GIF. Use JPG or WebP.

GIF persists anyway, because it plays inline everywhere with no player, loops automatically, and carries decades of internet culture with it. When you do need to keep one small, Compress GIF helps - see how to shrink a GIF.

FAQ

How is GIF pronounced?
Both "gif" with a hard g and "jif" with a soft g are in wide use. The format's creator intended the soft "jif", but either is understood.

Why do photos look bad as a GIF?
Because GIF holds at most 256 colours, and a photo needs thousands. It comes out banded or dithered. Use JPG or WebP for photographs.

Is GIF lossless or lossy?
The compression is lossless - but reducing a full-colour image to 256 colours to make a GIF loses colour up front. Few-colour graphics survive intact; photos do not.

Does GIF support transparency?
Yes, but only on or off - a pixel is fully transparent or fully opaque. There is no partial transparency, so soft edges come out jagged.

Should I still use GIF?
For a simple animation that must play anywhere, sometimes. For static graphics use PNG; for photos, JPG or WebP; for longer animation, a real video.

← Back to all guides