MyLeoNes™

How compression makes files smaller — Technology, 11–13 years

A photo, song or video can contain repeated or less important detail. Compression stores it more economically, making files quicker to save and send, although some methods lose detail.

The idea

Compression changes information into a shorter form. It may replace a long repeated pattern with a note saying how often it repeats, or remove details people are unlikely to notice. When opened, the file is rebuilt, exactly or approximately depending on the method.

Why it was needed

Uncompressed media can be surprisingly large: a clear video contains many pictures for every second. Storing and sending all that data would need more space and time. Compression solves this by reducing the amount of data while keeping the result useful to people.

A worked example

Suppose a row of pixels is blue, blue, blue, blue, blue, then red. Instead of storing six colour names, a simple method can store 5 blue, 1 red. That turns six pieces of information into two groups. If an image has many such runs, the saving becomes large.

The common trap

A common thought is that compression simply deletes random information. That would make the result unreliable, so it is a reasonable worry. In fact, lossless compression keeps everything but stores it cleverly; lossy compression removes selected detail according to what people notice less.

Where it is used

JPEG photos, MP3 music and many video formats use compression. Streaming services compress media so a film can arrive through a connection without using enormous amounts of data. The choice matters: a family photo may need faithful detail, while a temporary preview can accept more loss.

Keep exploring

Other languages

Loading MyLeoNes™…