1.2 Memory and Storage

1.2.5 Compression - click to expand

This page looks at a technique called compression, which is used to reduce the size of a file. In the past, this has been a very important topic because storage space was expensive and we had to make sure that it was used efficiently.

Modern computers can have vast amounts of relatively cheap storage space, but it is still important that we can compress data files because large files take longer to transfer to other computers.

The Need for Compression

In the early days of computers, storage was very expensive and limited. This was an issue and limited the kind of program that could be used on the computers.

As computers became more powerful, RAM and other primary storage devices were developed which vastly increased the storage capacity of the systems. This meant that new applications could be developed which often involved file sizes that were much larger.

It is possible to compress a file by using an algorithm to examine the file contents bit by bit and condense the information so that it fits in a smaller file size. One example of this is the JPG algorithm which uses many techniques such as reducing the number of blue and green colours in an image to make the file smaller.

For your exam, you need to know why we need compression. The reason that we need compression is so that we can fit files in a smaller storage space. Storage devices can be expensive and it is important that we use them efficiently. Larger files also take longer to transmit, both on a network and via the Internet. By compressing the image, we can speed up how fast the documents are loaded and transferred.

This is magnetic core storage, which was a primary storage device used before RAM was available. This device was about 50mm square and only provided 64 bytes of storage.

Lossy and Lossless Compression

We can compress a document using many different methods. Some of them, such as the JPG algorithm can compress an image into a tiny fraction of its original size. To do this, some of the information that is stored in the image is removed completely and cannot be restored. This is known as lossy compression.

Lossy compression can be used when it doesnt matter if some of the information is lost. Images, sound files, and video files can all use lossy compression to reduce file size. The amount of information that can be "lost" without affecting the quality of the restored file can be varied and even large amounts of compression which removes large amounts of data can be acceptable.

Some files would not work properly if even a small amount of data was removed. We can still compress these files, but we need to use a lossless form of compression. Text files and software programs are two examples of data files that must not have any information removed by a compression and decompression process.

In general, lossless compression cannot compress files as much as lossy compression.

Lossy compression is ideal for image, sound and video files where data can be lost without affecting the quality of final uncompressed file.

Lossless compression should be used on text and software files, where it is important that when the file is uncompressed, it is a perfect copy of the original file.

Quick Test (Requires login)

Other Resources for this topic