Compressed Data File Formats Explained

You're probably aware that some picture and sound file formats (for instance .jpg and .mp3) have smaller files than others (for instance .bmp and .wav), but do you know why? Well first of all, if you're not sure about how to find out what format your files are in, read this article about viewing file types in Windows.

Why files have formats at all.

All computer files are displayed to us in analogue format. Pictures, movies, text or sound. All of the files are saved on the hard drive in binary digital format, so some coding method is need to switch from one to the other. The coding softwere units are known as codecs. For instance, pictures can be coded as bitmap or jpeg files among many other types. The full file name illustrates this because each codec has a 3-letter file extension - picture.bmp or picture.jpg.

Picture File Compression

Bitmap, or .bmp is an accurate but innefficient way of coding pictures. It takes each pixel (very very small part) of the picture, and records its colour. If you have your colour set at 24 bit, that's over 16 million possible colours. All this makes for a lot of data to be saved.

Jpeg reduces the number of colours it has to deal with by ignoring the difference between colours that are similar, and displaying them as the same. When this is done delicately - for instance only combing colours that are adjacent in the 16 million colour pallette - it hardly affects the image at all. The more aggressive the compression is, the more the effect start to become noticeable. Area's of colour that should have a steady gradient start to display banding, and the clear definition of edges is lost. So when using jpeg formats, you just have to weigh up the advantage of smaller file sizes with the loss of quality. Here are some samples to demonstrate;
low compression
This picture is already jpegged - its file size is 62Kb and the definition and gradients are very good. The bitmap of the same file is 477Kb.

medium compression
This one is jpegged with more compression, so the file size is down to 17Kb - another good saving and so far we're just starting to lose edges - look closely at the island. Its off the coast of Lesvos in Greece if you want to go and take a real close look.

high compression
This one has gone a step further, and its a step too far. The file size is 13Kb (not much further saving) but now the sky is banded and a lot of definition is lost.

Music File Compression

When it comes to music files, the differences are harder to show, but the principal is much the same. Wave files (.wav) are an accurate but innefficient form of coding, running at around 10Mb for 1 minute of sound.
Mp3 is more efficient, somewhere around 1Mb per minute - this is why it became so popular because a good mp3 is hardly any different to a wave file, but much smaller which means its quicker to download and you can save far more on a disk.
Music in commercial audio CDs is in .cda, a format very like wave files, and for this reason you can only get 74 minutes onto a 700Mb disk. The same disk could hold 740 minutes (or thereabouts) in mp3 format.
Its also possible to overcompress by using less and less kilobytes per second, and this has become seriously unfashionable now that disks are bigger and download speeds are faster. The trend is for mp3's to be lower compression/higher quality.

Free Counters
Broadband Internet Services