Compression simply means that files are reduced in size. Algorithms are used to reduce the size of the file. This means files would take up less storage space and can be uploaded or downloaded faster.

Common mistake – Compression does not only refer to images. No marks would be awarded for an answer that states that the image would be reduced in size.

Lossy compression

This reduces the size of the file, but some of the data is lost and so the file cannot be returned to its original state. This means that an image could lose detail or a music track could lose clarity. This type of compression would not be suitable for text as you may not be able to read or understand the text in the compressed file.

JPEG and MP3 are common file formats that use lossy compression.

Lossless compression

This uses an algorithm that retains all the data but stores it in a more efficient format. This means that files created using lossless compression are larger than those created by lossy compression.

PNG and GIF are common file formats that use lossless compression.

Example of lossless compression

Original           The cat chased the mouse out the door and into the garden. (58 Bytes)

Compressed  & cat chased & mouse out & door and into & garden (50 Bytes)

By replacing common sequences with a representative symbol, the file has been reduced by 14%. The file could easily be reconstructed to its original state.

Compression Ratio

The compression ratio is the original file size compared with the new file size.

 Original File:                  200 kB  Original File:                 1.5 GB
Compressed File:           120 kB Compressed File:          700 MB
Compression Ratio:     5:3 (200:120) Compression Ratio:    15:7 (1500:700)
%d bloggers like this: