What happens if you compress a file




















As it turns out, the basic idea behind the process is fairly straightforward. In this article, we'll examine this simple method as we take a very small file through the basic process of compression. Most types of computer files are fairly redundant -- they have the same information listed over and over again.

File-compression programs simply get rid of the redundancy. Instead of listing a piece of information over and over again, a file-compression program lists that information once and then refers back to it whenever it appears in the original program.

The quote has 17 words, made up of 61 letters, 16 spaces, one dash and one period. If each letter, space or punctuation mark takes up one unit of memory , we get a total file size of 79 units.

To get the file size down, we need to look for redundancies. Ignoring the difference between capital and lower-case letters, roughly half of the phrase is redundant. Nine words -- ask, not, what, your, country, can, do, for, you -- give us almost everything we need for the entire quote.

To construct the second half of the phrase, we just point to the words in the first half and fill in the spaces and punctuation. We'll look at how file-compression systems deal with redundancy in more detail in the next section.

Most compression programs use a variation of the LZ adaptive dictionary-based algorithm to shrink files. The system for arranging dictionaries varies, but it could be as simple as a numbered list. When we go through Kennedy's famous words, we pick out the words that are repeated and put them into the numbered index. Then, we simply write the number instead of writing out the whole word. If you knew the system, you could easily reconstruct the original phrase using only this dictionary and number pattern.

This is what the expansion program on your computer does when it expands a downloaded file. You might also have encountered compressed files that open themselves up. To create this sort of file, the programmer includes a simple expansion program with the compressed file. It automatically reconstructs the original file once it's downloaded. But how much space have we actually saved with this system? In an actual compression scheme, figuring out the various file requirements would be fairly complicated; but for our purposes, let's go back to the idea that every character and every space takes up one unit of memory.

We already saw that the full phrase takes up 79 units. Our compressed sentence including spaces takes up 37 units, and the dictionary words and numbers also takes up 37 units.

This gives us a file size of 74, so we haven't reduced the file size by very much. But this is only one sentence! You can imagine that if the compression program worked through the rest of Kennedy's speech, it would find these words and others repeated many more times. Data redundancy is a condition created within a database or data storage environment in which the same piece of data is held in multiple places. 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 is mainly used for text and spreadsheets because losing words or data from a document isn't something you want to happen. Lossy compression functions basically the same way, but as you can probably tell by the name, it results in some data being permanently lost not as bad as it sounds.

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. There is a downside, however - If you compress the same file over and over again using the lossy method, you'll start to notice a reduction in quality since data is being removed each time.

If you're someone who frequently edits media files, you know how crucial file compression is when transferring photos, music, and videos.

You really don't want to kill all your bandwidth and waste tons of valuable storage space. If you're not one of those people, then here's why it's so necessary. Let's say you have a huge number of files on your computer, but don't plan on doing anything with them for a while maybe you're a virtual hoarder, who knows.

Leaving them on your hard drive to take up space isn't the most practical thing to do. Instead, you can ZIP a large quantity of files into a single archival folder that both frees up space and makes organizing a lot cleaner.

Storing your collection of old Kung Fu movies on a hard drive? Compress them all down into one ZIP file and be amazed at how much space you'll save. If you've ever tried emailing a really large file, you know it can take a long time. Even worse - trying to email several documents at once.

A lot of the time your message will fail because some email clients don't allow files over a certain size to transfer. Sure, you could send a series of multiple emails with small attachments on each, but that's both time consuming and hard to keep track of and you'll probably annoy the recipient.

By compressing your documents into one ZIP file, it will take up less space and transfer a lot faster. The recipient just needs to use a program like WinZip to extract the files and they'll have everything you sent them in one, organized folder. Hard drives are expensive - I don't have to tell you that.

Windows and macOS give you the basics, but other applications offer greater levels of compression, plus extras such as password protection, increased security, and broader archive format support. WinZip is available for both Windows and macOS, and is one of the oldest and most comprehensive compression tools around. It deploys banking-level encryption, connects directly to popular cloud storage accounts such as Dropbox, OneDrive, and Google Drive, and it includes extras such as PDF watermarking for additional document security.

PeaZip is available for Windows and is also completely free to use. The main difference is its interface, which is more stylish and polished than 7-Zip. This is another program that supports a large number of compression formats, and also offers features such as strong encryption and password protection for extra archive security.

David Nield is a tech journalist from the UK who has been writing about gadgets and apps since way before the iPhone and Twitter were invented. Now, if each letter and space in the sentence equals one unit of memory, then the entire file size would be units. But you can create a numbered code to express the data in a different way:. Or to put it a different way, both sentences would now read: This means that the initial file size of units is reduced to 18 units, which is a massive savings.

The ZIP file format uses lossless compression algorithms to do exactly that. It allows you to express the same information in a more efficient way by removing the redundant data from the file. This also means it is faster to send a ZIP file. There are a broad range of potential uses for zipped files in a business setting. Being able to send large numbers of files over email is imperative. Say you need to send a big batch of files to a colleague or client. If you try to send them all at once in an email attachment, you will get an error message because of file size.

So you could try to send each file as in separate emails. But this is time consuming, labor intensive, and could lead to duplicate files. To send all the files in one email, you can zip them and attach this single ZIP file to your email. Your recipient can then unzip the file by downloading and clicking. You should also consider any potential storage saving. Zipping your files can help to reduce the amount of space they use on your computer's hard drive.

You can find more information on how to zip files here. First, zipped files save storage space and increase the efficiency of your computer.



0コメント

  • 1000 / 1000