The File Formats

by Joe Gillespie — Apr 1, 2000

GIF tests

Big Deal could be saved in 4-bits (16 colours) with no perceptible loss of quality. It was saved with perceptual or adaptive palettes and no dithering in each program.

The three photographic images are more efficiently saved as JPEGs, but I also tried saving them as GIFs with 6-bit (64 colours) with dithering switched full on, again with perceptual or adaptive palettes. The only real reason to save a photograph as a GIF file like this, is if you need transparency or animation.

As it happens, two of the images have restricted palettes. The dog is mostly red/brown and the port scene, predominantly blue. The Sun Arch image has large areas of flat colour. More colourful images would look less good in GIF format because of the restrictions in the number of colours. In any case, the GIF (or PNG) will give a larger file size than JPEG for a similar (or even inferior) result.

More about GIFs

JPEG Tests

Each of the images was first subjected to a high degree of compression, and then the compression gradually backed-off until there came a point where the compression artefacts just disappeared. Interestingly, this 'threshold' happens at different compression percentages in each program. Smoothing was set to 'off' in each case where possible. The objective here was to get the same visual quality and then to compare the file sizes. I could, instead, have compared the quality at a fixed file size but this is more subjective and not something I would do in real life situations.

The Big Deal image, and anything like it, is totally unsuitable for JPEG compression, as the file sizes show, but I just wanted to demonstrate what happens. It is practically impossible to get rid of compression artefacts in flat colours like this with JPEGs, even with minimal compression.

More about JPEGs

PNG Tests

PNGs still aren't fully supported in current browsers. There are two main PNG formats, PNG-24 and PNG-8. PNG-24 is so much bigger than JPEG, it isn't really worth considering for Web images at all. PNG-8 uses a 256 (maximum) colour palette and gives a similar file size to GIF but, depending on the nature of the image and the number of colours, either format can win out under some circumstances. With the Big Deal image, most programs give slightly smaller PNGs than GIFs.

More about PNGs

Del.icio.us Digg Technorati Blinklist Furl reddit Design Float