Menu

Compression

Lossless compression

Lossless compression reduces a file's size without permanently removing any data. The data is stored more efficiently, and when the file is decompressed the original is rebuilt exactly.

It works by storing repeated patterns only once, with a note of where each copy belongs, instead of storing every copy. For example, if the same sequence of characters appears many times in a document, it can be stored once with references to each place it is used. Nothing is thrown away. Once a file compressed this way is decompressed, you get back an identical copy: every character, pixel and sound sample is restored exactly as it was. Lossless does not mean that no compression has taken place, or that the file stays the same size; it means that no data is lost.

Lossless compression: a repeated pattern is stored once with references to each place it belongs, and the decompressed copy is identical to the original because no data is lost.

Advantages and disadvantages

  • No loss of quality: the restored file is identical to the original, so lossless compression is safe for text, documents, spreadsheets and program files.
  • Works on any type of file: because no data is removed, it can be used for text, images, sound, video or anything else.
  • Smaller reduction than lossy compression: the file does get smaller, but not as much as a lossy version would. It therefore takes more storage space and takes longer to transfer than a lossy version of the same file.

Practise this