AXS GIFAXS GIF

GIF Colour Palette

Every GIF carries a colour palette — a table of up to 256 colours that its frames are drawn from. Because a photo contains thousands of colours, converting it to GIF means picking the best 256 (a step called palette generation) and mapping everything to them.

Reducing the palette further — say to 128 or 64 colours — makes the file much smaller but can cause banding in gradients. Good GIF tools generate an optimised palette per clip so the result looks as close to the original as possible.

Shrink a GIF by lowering its palette with Compress GIF.

The 256-colour ceiling

Each frame of a GIF references a colour table holding at most 256 entries, and every pixel in that frame must be one of them. Full-colour images draw from roughly 16.7 million possible values, so encoding one as a GIF means choosing 256 representatives and mapping everything else onto them. How that choice is made determines almost entirely how good the result looks.

Quantisation and dithering

Quantisation picks the palette, usually by analysing which colours appear most and clustering the rest around them. Mapping the remaining colours then happens in one of two ways. Snapping each pixel to the nearest palette entry is clean but turns smooth gradients into visible bands. Dithering instead scatters pixels of two palette colours in a pattern that averages to the missing shade, which the eye blends at normal viewing size. Dithering looks considerably better and costs real file size, because the scattered dots destroy exactly the local uniformity GIF compression relies on.

Why some clips convert well and others do not

Content with naturally limited colour — screen recordings, user interfaces, cartoons, logos, line art, text — often fits inside 256 colours with room to spare and converts with no visible loss at all. Content built from continuous gradients — skies, sunsets, skin tones, dim or noisy footage, anything with film grain — has no good 256-colour approximation, and the result either bands or turns noisy. If a clip in the second category has to look good, and the destination accepts video, send MP4.

Palettes and transparency

GIF spends one palette entry on transparency, and it is a switch rather than a range: a pixel is either fully transparent or fully opaque. There are no partial values, which is why GIF cut-outs show hard, stair-stepped edges rather than the soft ones PNG and WebP produce.

Try Compress GIF

Open Compress GIF