Return to site

How Do Zip Files Compress

broken image


If you've ever had to email, upload or download several large files or programs, you've most likely encountered ZIP files. Also known as compressed or archived files, ZIP files condense multiple files into a single location with the extension .zip or .ZIP, reducing the overall size and making them easier to transmit.

  1. Compress Zip File Size
  2. How Do Zip Files Compress Zip File

Phillip Katz invented the ZIP file in 1986, and it was first implemented with the PKZip program for Katz's company, PKWare, Inc. Eventually, Katz's compression method became common usage within popular operating systems. Microsoft Windows and Apple's Mac OS include built-in utilities to compress and unzip files, and programs like WinRAR, WinZip and StuffIt can expand them.

SEE ALSO: The History of GIFs
  • If it's a single file or folder you'd like to compress, right-click it and a menu will pop up. Click 'Send to,' and then click 'Compressed (Zipped) Folder.' You can also select multiple files or folders in Explorer, and then follow the same steps above to compress them simultaneously.
  • Zip Compress Multiple Files in Windows. Microsoft Windows provides a utility that allows you to zip multiple files into a single compressed file format. This is especially helpful if you are emailing files as attachments or if you need to conserve space (zipping files can reduce file size by up to 50%).

But how does it all work? What kind of technological magic is at play that makes your files smaller while maintaining all of the information for later?

That 'magic' is actually a pretty straightforward algorithm that takes the redundant aspects of a file and breaks it into smaller parts.

Zip format definitely does not reduce quality. There are two types of compression - lossless compression and lossy compression. And, the Zip format is of lossless type. In layman terms, a Zipping operation creates an index of long binary and character sequences in the files and assigns special symbol sequences to them. Open the 7-Zip application, then access the files you want to compress. Select those files and click Add. Make sure to put the files in the same directory. In the Add to Archive window, manage the settings as desired.

For an easy-to-understand example, let's take the sentence, 'Mashable can help make readers smarter; readers can help make Mashable smarter,' and pretend it's a file.

Every word in the example sentence appears twice. If each character and space in this sentence made up one unit of memory, the whole thing would have a file size of 78 units. If we created a numbered code — or 'dictionary' — for this sentence, it could go something like this:


1. Mashable
2. can
3. help
4. make
5. readers
6. smarter1 2 3 4 5 6; 5 2 3 4 1 6

This new sentence has only 24 units. Therefore, the compressed file would have only 24 units of memory in addition to another file that lists our numbered code, so that the compression program knows how to apply each unit of information. This is called 'lossless compression'; all of the original information is retained.

The way in which an actual compression program works is a little bit more complicated than the previous example — it would recognize patterns. An example is the letter 'e' and a space after 'Mashable' and 'make.' But since there aren't many instances in which this particular pattern occurs, the program would most likely overwrite it with a more apparent pattern. The actual program is able to find a much more efficient dictionary and compressed file than we could.

According to educational and instructional website HowStuffWorks, it's common for languages to have redundant patterns, which is why text files are easily compressed. But the file reduction ratio depends on several factors, including the file's type and size and how the program chooses to compress it.

In contrast, images and MP3 files contain more unique information without many patterns. That's where 'lossy compression' comes in — compression programs get rid of what they deem unnecessary information. If you had a scanned image, for example, with a blue sky, a compression program could pick one color of blue used for every pixel. If the compression scheme works well, the change wouldn't be very noticeable, but the file size would be significantly smaller.

The issue with lossy compression, though, is that you can't get the original file from the compressed file, making it less ideal than lossless compression when you need to retain all of the original information, such as when you're downloading databases and certain applications.

Mashable composite image courtesy of iStockphoto, tose, Auris.

7-Zip is a free program that allows for you to compress files and folders. The compression will reduce the file size and even merge multiple files into one for easy transfer.7-Zip can also open these archived files and extract the original documents inside. With 7-Zip you have access to compressing in different formats, including 7z and zip. The 7z format is one of the better archive methods and can compress file size down a notable amount.

How to Compress a File to Zip or 7z

7-Zip allows for you to archive files in four different formats; including Zip and 7z. You can use these formats and individually adjust the settings for each compression. Alternatively you can use the presets.

Once you have 7-Zip installed you should notice an additional '7-Zip' option when right clicking on a file or folder. When you hover over the 7-Zip heading you will have a choice of different actions.

https://softwareny.mystrikingly.com/blog/picasa-3-software. 1. Select the folder or file(s) that you want to compress.

2. Right click on a selected file and hover over the 7-Zip options.

3. Select 'Add to filename.zip' or 'Add to filename.7z' for quick compression. If you want to modify settings select 'Add to archive.'

4. If you selected the quick option the compression will begin. If you chose to archive then a new window will open.

5. Press the square dots button at the top right of the settings window. This will open a file explorer and allow you to choose a destination and file name for the archive you're creating.

6. Choose the Archive format that you want to use, 7z and Zip are recommended.

7. Enter the settings that you want, you can use the default if you want.

8. Press 'Ok' and the compression will begin.

Why Compress/Archive Files?

Save Time

Compressing files can be a great way to save time. Large files can take a rather long time to transfer, especially if you're uploading them online. The smaller size allows for you to transfer quicker. Another advantage is being able to merge all the files or an entire folder into one. This is great for hosting files online, as you will only need to download the one archived folder instead of each file individually. Although some online hosts allow for you to download multiple files at a time this feature is usually behind a paywall.

Efficiency

When dealing with large files, like video, being able to store all the content can be difficult. Fortunately archived files are much smaller than the original counterparts. This allows for you to make the most out of the storage space that you have.

Encryption & Password Protection

Compress Zip File Size

Although password protecting files and files isn't limited to archivers it is a great addition. Adding a password protection to your files allows for you to prevent unwanted eyes from seeing your documents. When uploading or sending files on the internet it's a great option to be able to password protect sensitive data.

Email Attachments and File Limitations

Websites and emails will often have attachment size limitations. Compressing your file(s) can help you meet these size restrictions. When emailing it can also allow you to fit more into one email, or avoid using a file hosting site.

Save Money

Online backups are becoming more and more popular, both for personal and business purposes. These services are usually priced by the size of storage needed. Because of this compressing backup files can save you money as you won't need as much storage.

Disadvantages of File Compression

Memory Issues or Slow Performance

Unpacking a compressed file requires memory, some older devices may have issues performing this task. Issues will usually display as a memory or low resource error. There is also the chance that you will notice general slow down when compressing and extracting files. Most current systems should be capable of running multiple programs and archive software at the same time.

Transfering Compatibility Issues

Not everyone is familiar with archive files. Even if they are there is a chance they don't have the right software for all formats. This can cause issues when transferring data online. Compression formats like Rar and Zip tend to be the most commonly used. If you plan on sharing files with other people it may be optimal to limit them to these types. Alternatively you can also send the person a link to 7-Zip with information on how to access the file.

Speed

Accessing a compressed file takes longer, as it needs to be extracted first. If you're trying to access a file quickly this may be an issue. Ensuring that you keep often used files uncompressed can help you avoid this.

Lack of Compression

Each file is different, and because of this some formats don't compress as well as others. Video and photo files tend to already have some level of compression to them. However this is dependant on the format used. Because of this you may see less than desirable compression rates at times.

Virus Threats

Files

People can hide viruses or malicious content in archived files. This could be an issue if you're receiving files from untrustworthy sources. You can however use antivirus software to scan the archive before opening. If you have an antivirus program active on your computer you can right click on the file and choose to scan it with your antivirus.

How to Encrypt a File with Password Protection using 7-Zip

A great option when creating file archives with 7-Zip is the ability to encrypt them. By adding encryption anyone that tries to access the file will need to enter a password. If you are trying to keep a document secure or prevent people from accessing critical information this can be useful.

1. Select the file(s) or folder that you want to archive.

2. Right click one of the selected files and choose the 'Add to archive' option by hovering over 7-Zip.

3. A settings menu will open. Choose the Archive format that you want to use, 7z or Zip is recommended.

4. Near the bottom right you will see a segment for Encryption. Enter the password you want to lock your file. You will need to enter the password twice to confirm it.

5. If you chose 7z format you can also check the box to encrypt file names for added security.

6. Choose your encryption method, some formats may only have one option. AES-256 is a good method however only limited archivers are capable of extracting them. If you are using Zip format you may want to use ZipCrypto instead.

7. Press Ok to begin archiving your documents.

How to Open an Encrypted 7z or Zip File

1. Right click on the file and choose to Extract or Open the archive.

2. How to create a bootable usb stick on ubuntu. You will be prompted for a password, enter it. If you chose to open archive you may not be prompted for a password until you try to open a document.

3. The encrypted file will begin to extract.

AES-256 vs ZipCrypto

Two popular methods of archive file encryption are AES-256 and ZipCrypto. When using archive software like 7-zip you may have a choice between the two. AES-256 offers better encryption however not all archive programs are compatible with it. Whereas Zipcrypto is supported by more programs. This is great as people are more likely to be able to open it without requiring additional software.

Best 7-Zip Settings for Maximum Compression

Compression rates vary depending on the files that you're trying to archive.The method of compression also affects how large the final file size will be. However there are some ways to optimise your settings in 7-Zip to ensure the better performance.

For our testing we included numerous different file formats. This way we could find the best general settings for multiple files. The files added up for about 1.63GB of data.

Compression Achieved with 7z: 1.05GB to 219MB

Compression Achieved with Zip: 1.05GB to 372MB

How to 7-Zip Multiple Files

A great advantage to archiving is being able to contain multiple documents in one file. This can be achieved in two different ways. Each method has their own advantages but achieve the same result.

Method 1

1. Select all the files you want to archive in one file explorer window.

2. Right click on one of the selected items and navigate to 7-Zip then Add to Archive.

3. Input your settings and destination.

4. Press Ok to begin.

Advantage; Only files will be compressed into the archive. If users choose to 'Extract to' a folder will be created for them. This folder will contain all of the documents neatly inside.

Method 2

1. Add all the files you want to archive into the same folder.

How Do Zip Files Compress Zip File

2. Right click on the folder and choose to Archive it.

3. Input your settings or use the default options. https://valuessoftware.mystrikingly.com/blog/wolf-responsive-form-maker-2-37-1080p.

4. Press Ok and the compression will begin to take place.

Advantage; When extracting files there is an 'Extract here' option. If this is chosen the folder will be extracted there. If only files were selected when archiving they will all be extracted to the current folder. This can cause them to get jumbled in with preexisting documents or cause issues.

Final Thoughts

7-Zip is one of the better archive programs available. It is capable of most if not all of the features available with other archive software. Archive programs can be highly useful for personal and business practices. 7-Zip allows you to save time and space, making it great for minimalist lifestyles. The unique 7z format is capable of high levels of compression and password encoding to help keep your files safe. Because 7-Zip is capable of opening numerous formats it's the only archive software you will need.





broken image