Web images: 4 - about GIF palettes

GIF palettes

As I mentioned, GIF files can display between 2 and 256 different colours, which together make up the palette.

Most decent bitmap editors allow you to specify different palettes for GIFs. For example, you'll probably be offered the web-safe palette - 256 colours that will (more or less) look the same on most platforms; an optimised, or adaptive, palette that uses the 256 colours that allow closest simulation of the original full-colour image, and greyscale - 256 shades of grey. And then, smaller palettes with say 64, 32 or 16 colours. Various methods of reducing the number of colours will probably be offered - you'll need to experiment to see which gives the best results until you are more familiar with the process.

What you choose will depend on both your audience and the subject matter. For example, here are three different images and their palettes:

image with overall blue cast

optimised palette for blue image

Image with overall blue cast, and its optimised (adaptive) palette of 256 colours

image with overall pink cast

optimised palette for pink image

Image with overall pink cast, and its optimised palette of 256 colours

image with overall pink cast, dithered to web-safe palette

web-safe palette for pink image

Part of the same pink image, but with the web-safe palette applied - eurgh! Because the web-safe palette contains a complete spectrum of colours, there is a limited number of pinks and purples to use for the sunset; hence the spotty (dithered) effect.

The smaller the number of colours in the palette, the smaller the file, so if you can get away with 16 or 32 colours for example, this is good. Screen shots and simple solid colour logos, for example, often lend themselves to small palettes.

image with 256-colour palette

Image with 256-colour palette as shown above centre; file size, 5787 bytes. This is just about acceptable at this size and colour depth.

image with 32-colour palette
32-colour palette for pink image

Image with 32-colour palette (shown); file size, 4817 bytes. The lack of colours available, even though they are mostly pinks and purples, means that the image is noticeably spotty - not really acceptable for this subject.

PNG images can be saved in an indexed format too - much the same considerations apply.