38.1 Introduction to Compression
Last updated
Last updated
As an introduction to compression, consider the processes of creating and unzipping a zip file.
Note that before and after unzipping, the file size changes!
In our first model of compression, we consider compression as applying a compression algorithm on a sequence of bits. To reverse the compression, we apply the inverse decompression algorithm.
Say you had a text file called example.txt
. If you were to zip that text file, you'd get example.zip
, a zip file with a size much lesser than the original example.txt
file. This is the main idea behind compression--a technique used to reduce file size.
Then, if you were to unzip example.zip
into a file called unzippedexample.txt
, you would notice no difference between example.txt
and unzippedexample.txt.
This is an indicator of lossless compression, where no information is lost.