How does file compression work?

1.26K views

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

11 Answers

Anonymous 0 Comments

Some files have patterns in them. The compression tool looks through the file and finds the patterns. Then it makes a new file with one copy of the patterns, followed by the rest of the file including a marker for “pattern 1 goes here” or “pattern 5 goes here”. Since the markers are smaller than the patterns, and some file have a very large number of certain patterns, the compressed format of the file can be much smaller. Some files don’t compress well, and the compression doesn’t make them any smaller.

Above I’ve discussed lossless compression, where no information is destroyed. There are other approaches used to compress sounds or images, that also lose some less significant information, but those operations are not lossless.

You are viewing 1 out of 11 answers, click here to view all answers.