±«Óătv

Data compression

Sometimes a digital file may be too large for us to store or download. An image captured by an 8 megapixel camera could be up to 15 megabytes in size.

Large files take up storage space and take longer to upload or download. can reduce the upload and download times of this file.

An animated explanation of lossy and lossless compression

Lossless compression

Sometimes we do not want to lose any of the information in a digital file. For example, if anything were removed from a text file or computer program then it would not read or run correctly.

Compression that doesn't lose any of the file's original quality is known as lossless compression. Lossless compression looks for patterns in the data. When it finds repeating patterns in the data, it takes the pattern and stores how many times the pattern occurs. An common example of this is 'zip' files.

Lossy compression

Lossy compression involves removing some of the data from a digital file in order to reduce its size. Lossy compression often reduces file size better than lossless but, once a file has been compressed using lossy compression, the lost data cannot be retrieved.

In the lossy compression of a sound file for example, the data removed might be sounds that the human ear is unable to hear, making the loss of quality as small as possible. This type of compression is often used for images, videos and music and is very helpful when streaming and downloading files.

Low compression image showing high detail contrasted with poor detail on high compression image.