MFKFKJL LLC
← The reading room

01 / Lossless compression · General technology reading

Smaller files, complete information

A smaller file can still contain everything needed to rebuild the original. Lossless compression changes the representation of information while preserving a route back to the same bytes.

Illustrative shorthandAAAAAA → six A charactersA shared rule makes the description reversible.

A different description

Compression takes advantage of patterns. Repeated sequences or predictable symbols may be described more economically than in the original. The compressed file needs enough structure for a decoder to interpret that description.

In a hypothetical example, repeated letters could be described by the letter and a count. That is a simple illustration of encoding, rather than a complete file format. Real formats need rules for literal characters, counts, boundaries and exceptional cases.

The round trip matters

The defining question is whether decompression reconstructs the exact original sequence. A lossless method preserves that sequence, provided the encoded data remains intact and a compatible decoder is available.

Lossy compression serves a different purpose. It may discard details to achieve a smaller representation. An image can look similar after such a transformation while its pixel values differ. Visual similarity and exact reconstruction are different requirements.

Smaller is conditional

Not every input becomes smaller. Data with little exploitable redundancy may offer few savings. Format overhead can even make a short result larger. Recompressing an already compressed archive often brings little benefit.

Compare the resulting size and the resources needed to encode and decode the particular data. Keep the original and check the reconstructed output. A usable round trip matters more than size reduction alone.

Further reading: IBM: data reduction. An external educational reference.

Continue exploring

A fingerprint for a file

What does a matching hash actually establish?