Compression

Home Lossy Lossless

Lossless compression

...makes a file's size smaller, while retaining all important information.

This means there will be no noticeable change in a file's appearance or contents, yet it's file size can still be reduced (though not as much as with lossy compression).

This is done by using techniques such as run-length encoding or dictionary encoding.

Run length encoding

...replaces series of repeating data with a two values - how many times it repeats, and the data being repeated

This means less data can be stored, and all of it is reconstructable.

Dictionary encoding

...works by recording frequently used sequences in a file, and replacing them with shorter references.

When the file wants to be read or edited again, the whole file can be fully reconstructed from the dictionary.

Example of run length encoding. aaabcccc is turned into a3 b1 c4.