Advertisement

Article

The Magic of File Compression: How It Saves Space and Improves Performance

Find out why it is so important to compress a file correctly

The Magic of File Compression: How It Saves Space and Improves Performance
Mireia Fernández

Mireia Fernández

  • Updated:

Every day we interact with a lot of files from our computer. Although we don’t often think about it, we work with reports and documents in PDF format, we download videos and music to enjoy our free hours and we spend a good bit of time processing photos and selfies for our new Instagram post. All of them have one factor in common: If they weren’t compressed, we wouldn’t be able to share them over the Internet and we would barely have any space on our computer to save them. But… Do you really know what file compression is?

In today’s article we are going to explain how file compression (normal and multimedia) works, why it is so important to compress files and how you can make the most of this process in your daily life.

What does it mean to compress a file?

To compress is to make a file take up less space without corrupting it.

The files stored on your hard disk occupy a certain amount of space on the disk surface. If you keep adding more data, there will come a time when there will be no more space left.

Before file compression was invented, there were only two options: delete files or add more space by buying a new hard drive. Two impractical options.

Compression applies mathematical methods – algorithms – to the data to make it take up less disk space, removing the need to erase or enlarge the space.

How file compression works

There are two main types of compression:

  • Lossless– One in which there is no loss of data.
  • Lossy– One in which part of the data is lost.

Which is better? The answer is not simple because both types of compression have their advantages and disadvantages. In the following table you can see some examples of file formats and their compression type:

Note that sometimes a format is used to join several files into one without compression, which is the case, for example, with the ISO format. In this case we are talking about file packaging, which is also possible with the ZIP format.

We will now discuss in detail how the main file compression systems work.

How lossless compression works

Lossless compression consists of analyzing the file in search of repetitions and patterns that can be summarized. It is the closest thing to compressing an accordion. See, for example, this document with various types of data:

When compressed in ZIP format, which is lossless, this is what happens to the original “accordion” which is our example file:

As you can see, the repeating sectors have been greatly reduced, but the data has not been lost: the ZIP format has stored instructions on how to “reinflate” the file for use.

Note also how some of those sectors (the gray ones) have hardly been compressed at all: this is because the redundancy level of those parts is lower. In other words, if nothing is repeated, the compressor does nothing. This explains why compressing highly optimized files, such as JPGs, is useless.

Another reason why parts may remain uncompressed is that each type of data requires a different approach to lossless compression. That is why nowadays it is preferred to use specific compressors for certain types of files, commonly called codecs.

Almost all file compressors (WinZip, WinRAR, 7Z) use lossless compression because it is reliable and secure: data integrity is maintained, and that is its biggest advantage. If you need to reduce the space occupied by important documents, lossless compression should be your first choice.

The main drawback of lossless compression is that it is not always efficient, and that the space savings it achieves are less than those obtained with lossy techniques.

How lossy compression works

Lossy compression reduces the space occupied by a file using a rather more radical technique: it removes information that is irrelevant to the human senses.

For example, JPG compression reduces the brightness and color variations of a photo, while MP3 format eliminates sound frequencies inaudible to the human ear.

In the image you can see how the waveform of an uncompressed WAV file (above) compares to the MP3 version at 40kbps. One thing to keep in mind is that while lossless compression is always maximum, lossy compression is adjustable by the user as if it were a TV control.

As you can see, the difference between the first image and the second one is almost imperceptible. When compressing with a lossy algorithm, we must always ask ourselves what level of quality we consider acceptable for the use we are going to give to the compressed document. It is important to consult a preview and not to overwrite the original.

Another clear example can be seen in the image above. Here we see how the RIOT compressor is able to reduce the size of an image from 865 Kb to only 21 Kb. The undeniable advantage of lossy compression is that it manages to reduce the size of files dramatically without the content becoming meaningless.

Thanks to its power, lossy compression enabled the growth of the Internet in the late 1990s with JPG images. The MP3 format, on the other hand, revolutionized the digital music landscape (and made Napster and the iPod possible).

And in recent years, compressed video formats have transformed the film and television industry. By being able to send more data in less time and taking up less space, authors and audiovisual consumers have gained.

Why it is important to know how to compress files

Now that you know in detail what file compression is and how it works, it is time to explain why it is so important to learn how to compress correctly. This is a process that has changed the way we not only relate to the files stored on our computer, but also the way we can share them.

These are the main advantages of compressing a file:

1. Take up less space

As we have already explained, compressing a file considerably reduces the size it occupies on the hard disk. This allows us to store a large number of files (documents, photos, videos, programs and files of all kinds) on a computer without having to delete them.

Hombre utilizando un portátil

2. Allows to make backup copies

File compression makes it possible to back up any type of file quickly and conveniently. Afterwards, it can be easily and securely stored on a removable hard disk drive or USB device.

3. Facilitates file transfer

Compressing a file not only makes it easier to transfer it between local devices, but is also a prerequisite for sending large files over the Internet. This makes it much easier, for example, to copy content from one computer to another or to send documents and programs quickly and efficiently over the Internet.

Hombre utilizando un PC
man using a computer

4. They can be sent by email or uploaded to a web page.

Most free email services, such as Gmail or Outlook, restrict the size of attachments in your email. The same is true when uploading images and files to a web page. File compression allows a file that was previously restricted by these limitations to be shared without a problem.

5. Maintain their integrity

It is very common that, when sending or sharing files over the Internet, they suffer some kind of error, become corrupted and thus unusable. A compressed file maintains the integrity of your files, thus ensuring that your data is not corrupted.

The best programs for compressing and decompressing files

1. WinZip

With 30 years behind it, WinZip is still the software of reference when it comes to compressing and decompressing files. It is capable of compressing and decompressing between a wide variety of formats (ZIP, ZIPX, RAR, 7z, TAR, etc.) as well as allowing its integration with Office-caliber programs.

In addition to being able to compress in a single file, WinZip offers the possibility of splitting large files into different parts to make it easier to decompress them. All this is accompanied by a simple and intuitive interface, perfect for any type of user to be able to compress and decompress without problems from the first moment. A must-have.

WinZIP DOWNLOAD
9

2. WinRAR

WinRAR is, along with WinZip, the best known and most awarded software when it comes to compressing and decompressing files. Don’t let its name fool you, because although this is the program par excellence created to decompress RAR, it is compatible with most (if not all) file formats on the market.

Although WinRAR doesn’t have an interface as attractive and simple as WinZip’s, this shouldn’t discourage you. The program has a wizard that can guide you through the whole compression and decompression process in a matter of seconds. Undoubtedly, it is the program to go to if you need to work with the RAR format.

WinRAR DOWNLOAD
9

3. 7-zip

To finish our selection we would like to recommend 7-Zip. Unlike WinZip or WinRAR, this is a completely free program, so you won’t have to spend money to buy a license. It has its own compression format, 7z, which is capable of compressing up to 16 GB, as well as being compatible with the main formats on the market.

7-Zip is a fast, powerful and efficient program. The only factor in which it perhaps lacks is its interface, which can be confusing and somewhat overwhelming for novice users. Nevertheless, once you get over the learning curve, it is an excellent program and worthy of being among the top 3 programs for compressing and decompressing on the market.

7-zip DOWNLOAD
9
Mireia Fernández

Mireia Fernández

Mireia Fernández es una apasionada del mundo de los videojuegos y las nuevas tecnologías cuya afición se remonta al MSX HB 501p de su niñez. Nacida y residente en Barcelona, Mireia lleva más de 10 años ejerciendo como editora y está especializada en la redacción de análisis, tutoriales y guías de software así como también en darlo todo para tratar de publicar noticias antes que nadie. Entre sus aficiones está pasar horas y horas jugando con la consola, pasear a su golden retriever y mantenerse al día de las novedades del mundo SEO.

Latest from Mireia Fernández

Editorial Guidelines

Advertisement