Title basically says it all. I understand how photos and videos can trade quality for file size, but files like games or large folders can be shrunk into a .rar or .zip file, transferred, and pulled back out with no loss to functionality. How does that work? If nothing’s being taken away how is space being saved?
In: Technology
Lossless compression works finding a more efficient, compact way to represent exactly the same information contained in the input so it can be restored later, identical byte by byte.
There are several possible strategies, depending on the nature of the data.
In example files can contain predictable almost fixed sequences (headers, padding to align fields), or data can be correlated and partially predictable as in pictures (PNG compression is lossless), or audio/video files, so only variations from the prediction needs to be stored.
Another classic example is text, where letters are encoded using one byte (or even more bytes) which is quite inefficient because there are less letters than possible byte values.
In other cases an archive can contain multiple version of a file, and differences in each version can be tiny, so any subsequent version can be stored in a negligible amount of space.
In almost all kinds of data can exist some sequences which are more frequent and can be substituted by shorter sequences, and so on…
Strategies are almost infinite, but all revolves around finding a more concise way to tell the same message.
Latest Answers