Can I ZIP my pictures or MP3 files to save space?

Can I ZIP my pictures or MP3 files to save space?

By Leo Notenboom

ZIP is a very popular compression algorithm supported by many popular programs such as WinZip, 7-Zip, and recent versions of Microsoft Windows. ZIPping a file or set of files can often reduce their size significantly at the cost of needing to be unzipped before they can be used.

Note though that I said, “…often reduce their size.”

Unfortunately, “often” doesn’t mean “always.”

The short answer

ZIPping photographs, music, and videos will typically not make them significantly smaller and can even make them slightly larger.

To understand why that might be, we need to look into how compression works at a high level.

About compression

While the specifics of many different compression algorithms is often the stuff of research, theses, and even patents, the concepts of compression are actually fairly simple.

The idea is that information stored on disk is often stored in a way that is less than optimal for storage. It may be optimal for other purposes, but as a side effect, there may be redundant information in the data that could be represented differently.

A simple compression algorithm is “run length encoding.”

Consider the following text:

This is a row of 10 asterisks: ********** followed by text.

That’s 59 characters long. If we define the character “+” to not be a plus character, but rather an indicator that the next two characters are a count, and the third character the character that should be repeated that many times, we get this:

This is a row of 10 asterisks: +10* followed by text.

We’ve shortened or “compressed” the text to only 53 characters, but it still means exactly the same thing. When decompressed, the “+” is encountered causing the “10*” that follows it to be read and replaced with 10 asterisks. The original uncompressed text is restored.

This is a row of 10 asterisks: ********** followed by text.

Read the rest of the story here..

This post is excerpted with permission from Leo Notenboom.

Stop Responding to Threats.
Prevent Them.

Want to get monthly tips & tricks?

Subscribe to our newsletter to get cybersecurity tips & tricks and stay up to date with the constantly evolving world of cybersecurity.

Related Articles