File Compression

What is File Compression?

File Compression is a process of packaging a file or folder (multiple files) into a compressed archive file which uses less space to store files on your hard drive. It works by reducing the redundancy in file’s code. It allows you to compress numerous files into one single file, which is smaller than the combined size of all the files. Once, a file is compressed, you need to decompress it and extract the files in order to read these files.

To perform this compression there are many tools available, some of the tools are WinZip, WinRAR, 7-Zip, ZipGenius and SimplyZip and Stuffit etc. Each one of these compression methods uses a unique algorithm to compress the data. Some of the file formats for compressed files are .zip, .gz, .rar, .sitx, .7z, .zoo, .z etc.

How is this achieved?

File compression algorithm accepts one or more related files, combines them and reduce their size to make them more suitable for storage or transmission. Each compression algorithm is different but they work in similar fashion. The main technique used in file compression is removing the redundant data from each file by replacing the common words or patterns with similar variables.

For instance, the word "Application" may be replaced with the number 2, which takes less space than the original word. The more times the word "application" is found in the file, the more effective the compression will be.

Why do I need to compress files?

  • Lessened transfer time: Compression / archiving of files will allow you to combine two or more files into a one single file. This helps you in transferring multiple files in a single command, instead of sending them one-by-one, many times, hence the transfer time is reduced.
  • Reduced storage space: It reduces the size of a file (group of files), smaller than the uncompressed ones. When a file(s) is compressed, the resulting “archive” file takes 50% to 90% less hard drive space compared to their uncompressed formats.
  • Ease File Transfer: It becomes necessity while sending large documents over internet via email attachments. because, most email clients have size limitations of the email message, ion such cases you can compress the file and reduce the file size accordingly..
  • Transferring files over internet in an uncompressed format may corrupt your files.

Types of File Compression

  • Lossless Compression: This compression uses a process which compresses the files without any loss of data. The files size after decompressing will be the same as that of the file before decompressing or even compressing. Example for this is LZW method. This method is efficient for files containing repetitive information, such as text, or monochrome image files, such as GIF (Graphical Interchange Format) or TIFF (Tagged Image File Format) files.
  • Lossy Compression: This type of compression might result in loss of a small amount of data after decompressing. That is the files will not be fully restored after decompressing them. But, it’s very less and cannot be noticed for the unless the same file is compressed multiple times. Example for this is “codec”. Suitable files for this type of compression include streaming media, audio files and image files such as JPEG (Joint Photographic Experts Group) or PNG (Portable Network Graphics) files.