Tuesday, November 02, 2004

Some Basic Facts about GIFs

I wrote code for creating images, drawing waveforms on them, and saving them in different formats for a few years. But I didn't know some basic facts until recently. Here are some basic facts.

Why GIFs are smaller compared with bitmaps?

It's both a compression thing and a color thing.

The GIF format uses compression, the BMP format (with rare exceptions) doesn't. So GIF is smaller because the image is compressed.

GIF only supports 8 bits per pixel. BMP normally uses 32 bits per pixel. So that's another reason GIFs are often smaller.

GIFs are often referred to as a lossless format. This is only really true if your original image was an 8bpp image. The only genuinely lossless formats widely used are PNG and TIFF.

An image in GIF format includes the headers, lookup table, and the imagedata in compressed form. An image in BMP format includes headers, imagedata, palette (if present), etc.

I learnt those basic facts from Chris Tavares, Chris Anderson (Merak), and Ian Griffiths.


Post a Comment

<< Home