File Compression

File compression is a data compression method in which the logical size of a file is reduced to save disk space for easier and faster transmission over a network or the Internet. It enables the creation of a version of one or more files with the same data at a size substantially smaller than the original file.

How does file compression work?
Depending on a number of factors Content compression can be as simple as removing all extra space characters, inserting a single repeat character to indicate a string of repeated characters, and substituting smaller bit strings for frequently occurring characters.

Essentially, there are two main types of file compression. lossless and lossy. Lossless compression takes your files and reduces their size without losing any information. Lossy compression reduces your file size by chopping off bits and pieces that aren't 100% necessary to function.

Lossless file compression
This may sound crazy, but it's how it works. In order for lossless compression to work, a file needs to be reduced without losing anything. This is done by removing redundancy. By eliminating redundancy, you are left with just one instance of each bit of data.

Lossless file compression would be like taking this:
AAABBBBBCC
and compressing it to this:
A3B5C2

The same information is there, but it's simplified to takes up less space (Note that the numbers correspond to the number of times that the previous letter repeats). This way, when you decompress (unzip/open/extract) the file, it knows how to go back to its original form. This is mainly used for text and spreadsheets because losing words or data from a document isn't something you want to happen.

Lossy file compression
Lossy compression functions basically the same way, but as you can probably tell by the name, it results in some data being permanently lost.
This is more common with media files like video, audio, and images because they don't really suffer too much from the data loss. In fact, music and videos you currently have on your computer have probably been compressed and you don't even notice the missing bits. This is because the data that's removed is outside of the range humans can hear or see.

No comments:

Post a Comment