Computer Compression

Hamza Jadid
2 min readJul 31, 2022

Compression isn’t something new, people used to compress things even before computers, folding papers for example, so if you have a piece of paper containing some information or data, you can’t keep it in its flat state, so to make it mobile you have to fold it, to reduce its size so that it can be carried easily.

Papers
Credit: Jose A. Bernat Bacete/Getty

However, compression has its disadvantages as well, when something is compressed it becomes “unreadable”, so if you fold a paper it’s no longer readable.

There are many levels of compression, you can compress a file too hard to make it small in size or you can lightly compress a file but its size will just decrease in accordance. Going back to the first example, we can fold a paper 4 times and it will surely become smaller than folding it 1 or 2 times, but here’s where things get tricky, there’s a limit to how much we can fold a paper, the same case applies when compressing a computer file.

But why should we compress a file lightly? why not always compress it highly? Well, the more you compress, the harder/longer it takes to decompress that file, a 5-times folded paper will consume more time in the unfolding process than a 1-time folded paper.

Compression comes in different algorithms or methods, and each one of those methods is used for a certain case. Back to the paper’s example, we can fold a paper or scrabble it. Folding is used to keep information and maintain the geometry of the paper. On the other hand, scrabbling is used in case we want to play with the paper, or simply throw it in the trash.

Compression could be used for other purposes, for example, you can wrap a newspaper and try to kill a fly with it, well the same idea is used in computers, sometimes you don’t care about reducing the file size, rather you just want to add a password for accessing those files, or you send a single file in your email instead of 10 attachments.

The full article is available on my blog since Medium currently doesn’t support tables and URL images out of the box.

https://blog.ghamza.dev/posts/computer-compression/

--

--

Hamza Jadid

I talk about computer science and software engineering