File Types & Compression

In the section on filename extensions in the Windows chapter, you learned about different filename extensions for different kinds of files. Maybe you noticed that some file types had more than one extension. For example, images could have .jpg, .gif, or .png. Movies could be .avi, .mpg, or .mov.

In fact, there are many, many more file types. For images, there are also the extensions .bmp, .pict, .tiff, and .psd among others. For movies, there is also .mp4, .wmv, .dv and others. Sounds have many different types, including .mp3, .wav, .aiff, .aac, .wma and many more.

What is the difference between these different file types? The answer is usually "compression."

Compression is when you try to make something smaller, without losing quality. For example, let's say you have a CD with 700 MB of space. You want to put some photos onto it. If you save photos in their original form, each photo might be 7MB in size, so you can only put 100 photos on the CD. That's not many photos, and 7MB is a large size for one photo. Is it possible to "compress" the photo so that it is only 1MB? The answer is "yes." By using various tricks, you can cut the size of an image from 7MB to 1MB, even though the visual size and quality of the image are still about the same. That's compression.

The most common image type on computers is the JPEG (pronounced "jay-peg"), often written as JPG. The JPG format allows you to choose the compression. With no compression, the file size is big, many KB or MB. With some compression, the file size becomes smaller, and the quality is still good. Too much compression, however, and the file size is very small, but the quality becomes bad. Look at this picture:

That has no compression, 100% quality. The file size is 100KB. Next:

This picture above has 50% compression, and 50% quality--but the quality is still very good. Maybe you can't see the difference with your eyes very easily. You might notice that the contrast (dark-to-light difference) is not so high, for example. But this file size is just 24KB--the file size was reduced to one-fourth of the original! Lots of disk space was saved. However:

This image has 100% compression, and 0% quality. You can clearly see the poor quality of the image. The file size is very small, only 8KB, but you don't want the quality to be so bad. So 50% compression is probably the best compromise.


The same is true of many other kinds of files. Take audio, for example. When you buy a music CD, the music files are in the AIFF format. This is an old format, and the compression is not very good. One song might be 50MB in size. For a 700MB CD, that allows you to get about 12 songs on one album.

Portable music players, however, have limited disk space. If you have an iPod, for example, you want the songs to be smaller. So when you transfer the music from your CDs to your computer using iTunes, iTunes will change the music from the AIFF format into the MP3 format. A 50MB song on an AIFF CD will become a 5MB song as an MP3. The song quality sounds almost the same, but the size is only 10% of the original! Now you can put 10 times more music on your iPod. Cool!

Just like JPG images, MP3 audio files can have stronger or weaker compression. That 50MB song from your CD could be compressed down to only 1MB in size as an MP3--however, the quality would become terrible.

the situation is very similar for movies; a DV file type might be huge. An MPEG-2 (the type used on video DVDs) is also very large. An AVI movie would be smaller, as would an MP4 movie.

These compressed file types are often used on the Internet so it will take much less time to download the images, audio or movies.