MyLeoNes™

Data compression — Computing, 7–10

Learn how computers make some files smaller by describing repeated or less important information more efficiently.

Smaller descriptions

Compression stores the same useful information in fewer bits, rather like shortening a sentence without losing its meaning. It may spot a pattern and record the pattern once, or leave out details people will not notice. The computer can then unpack the file, if the method allows it.

Why compress files

Photos, songs, and videos can contain enormous amounts of data. Large files take more space and longer to send, which was a problem even more serious when storage and networks were slower and dearer. Compression saves space or time, although it may require extra work to pack and unpack.

Repeating pixels

Imagine a strip with 20 identical blue pixels. Without compression, the computer records the colour of all 20 positions. With a simple run-length method, it can record “blue, 20 times”. The picture looks the same, but the description is shorter because the pattern repeats.

Compression is not always lossless

It is reasonable to think that every compressed file can return exactly to its original form. Some methods do that, like packing repeated text. Others remove details that people may not notice, making a photo or song smaller but slightly different. The right method depends on what must be preserved.

Smaller files in daily life

Compression helps a photo upload faster, a video stream use less data, or a group of documents fit into one archive. When you send a ZIP file, you are usually using lossless compression. When a website shrinks a photograph, it may choose a little quality loss to save much more space.

Keep exploring

Other languages

Loading MyLeoNes™…