Technology in terms you understand. Sign up for my weekly newsletter, "Confident Computing", for more solutions you can use to make your life easier. Click here.

Can I ZIP My Pictures or MP3 Files to Save Space?

//
Can I ZIP my pictures or MP3 files to save space?

ZIP is a very popular compression algorithm supported by many popular programs such as WinZip, 7-Zip, and recent versions of Microsoft Windows. ZIPping a file or set of files can often reduce their size significantly at the cost of needing to be unzipped before they can be used.

Note though that I said, “…often reduce their size.”

Unfortunately, “often” doesn’t mean “always.”

Become a Patron of Ask Leo! and go ad-free!

The short answer

ZIPping photographs, music, and videos will typically not make them significantly smaller and can even make them slightly larger.

To understand why that might be, we need to look into how compression works at a high level.

About compression

While the specifics of many different compression algorithms is often the stuff of research, theses, and even patents, the concepts of compression are actually fairly simple.

The idea is that information stored on disk is often stored in a way that is less than optimal for storage. It may be optimal for other purposes, but as a side effect, there may be redundant information in the data that could be represented differently.

A simple compression algorithm is “run length encoding.”

Consider the following text:

This is a row of 10 asterisks: ********** followed by text.

That’s 59 characters long. If we define the character “+” to not be a plus character, but rather an indicator that the next two characters are a count, and the third character the character that should be repeated that many times, we get this:

This is a row of 10 asterisks: +10* followed by text.

We’ve shortened or “compressed” the text to only 53 characters, but it still means exactly the same thing. When decompressed, the “+” is encountered causing the “10*” that follows it to be read and replaced with 10 asterisks. The original uncompressed text is restored.

This is a row of 10 asterisks: ********** followed by text.

Compression doesn’t always compress

In the example above, we took a line of 59 characters and “compressed” it to 53 characters. It’s not a great compression algorithm, but it worked.

Now, let’s compress this text using the same algorithm:

Here's a single plus sign: + followed by text.

That’s 46 characters long.

The problem is that because it actually contains the plus sign, the character we said was special in our compression algorithm, we can’t just let it be. If we do, the decompression algorithm will look at it and say, “Oh, the next two characters are a count of the number of times I should repeat the third character following,” which is simply wrong.

Unless we specially encode the plus character:

Here's a single plus sign: +01+ followed by text.

That allowed the decompressor to follow its algorithm: “+” means the next three characters are a count (one, in this case) of the number of times to repeat the third character (“+”). The compression and decompression algorithm works.

The only problem is that the “compressed” data at 49 characters is now larger than the original 46.

Every compression algorithm faces this problem. My little example above was crafted to make it easy to show, but even the most advanced compression algorithm will have situations where compressing particular forms of data may cause the “compressed” data to be larger than the original.

Compressing already compressed data

One of the most common ways that compressed data can end up larger than the original is if the original is itself already compressed.

Let’s look at the compressed version of my silly little example again:

This is a row of 10 asterisks: +10* followed by text.

What happens if we try to compress that data again? Well, as we saw, that single “+” sign is a problem and needs to be treated specially:

This is a row of 10 asterisks: +01+10* followed by text.

The result is that the “compressed” data got bigger than the original.

Or rather compressing the already-compressed data made it larger.


One of the most common ways that compressed data can end up larger than the original is if the original is itself already compressed.
This happens most reliably when you compress twice using the same algorithm, but if the compression techniques you’re using are relatively efficient, then the algorithms don’t matter as much. ZIPping something twice makes the second zip larger than the first. But ZIPping a “RAR” file, also a compressed file, will typically result in something bigger than the original.

With that as background, we can finally explain our answer to the question.

Pictures, music, and videos are already compressed

Pictures in popular formats such as .jpg, .png or .gif are already compressed.

Music files in formats like .mp3, .ogg, .aac, and so on are already compressed.

Video files in formats like .wmv, .m4v, .mov, and more are already compressed.

And as we’ve seen by now, depending on the type of compression you’re using, compressing an already-compressed file at best does very little and at worst makes the file bigger.

So there’s typically no space-saving advantage to ZIPping a photo, a movie, or an MP3.

ZIPping is more than compression

Of course, creating a .zip file is useful for more than just compression.

It can be handy to ZIP several files (for example, a collection of several pictures) together, combining them into a single file for a single download, attachment, or file transfer.

People still need to unZIP before they can see them, but it can be simpler to transfer only one file rather than several.

39 comments on “Can I ZIP My Pictures or MP3 Files to Save Space?”

  1. Obviously ANY uncompressed format should compress some using ZIP. But it’s not always obvious which files are, or are not compressed. For example some BMP files actually are compressed. Same for some .WAV files.

  2. my mp3 player is supposed to hold 4 hours… roughly 60 songs at 4 minutes each, right? but i can only fit around 30 on it, so there’s gotta be a way to basically cut their size in half, but i don’t know how?

  3. There are different levels of compression in MP3 that can be traded off against the quality of the sound: the better the quality of sound, the bigger the file. When an MP3 player’s manufacturer indicate how many songs a player might hold, they’ll typically assume better-than-average compression. If you have your own audio software you can adjust the compression if you like, but you’ll probably notice that the quality of sound will degrade.

  4. I DOWNLOAD A LOT OF PICTURES FROM INTERNET EXPLORER,CLOSE TO 900.WHEN I OPEN UP MY PICTURES LAST WEEK THEY SHRUNK TO A HALF-INCH.HOW TO I GET THEM BACK TO THE ORINGINAL SIZE? WHAT IS THE URL ABOVE STAND FOR? I AM NEW AT THIS.THANK YOU

  5. Please tell me how to email mp3 or other audio files. I have these audio files (majority in mp3 format) stored in my hard drive and now I need to attach these in my emails? If I attach these audio files, will the receiver be able to listen to these mp3 with good quality? Thanks for your time.
    Roy Abraham

  6. hello, how do i send folders of large JPGs from my home computer to my school’s yearbook computer? i’m a photographer for them and i’m worried about compression or any degradation of quality. can i zip them or does that ruin quality? should i just put images onto a CD? thanks

  7. Zipping will not affect quality. It just won’t make them any smaller. Depending on how big things are, you may be better off with a CD, yes.

  8. Hard to say without more details. It’s possible that your email provider has a limit on how big an email can be, and the mp3’s as attachments excede that size.

  9. Hi there, I’m going to be buying a new pc soon, is there any way of putting my mp3 files onto a cd so that i can just burn them onto the new hard drive instead of downloading them all again?

  10. how do i save my pictures from my computer to a cd or a dvd? for back up in case comp/crashes or breaks. what do i do zip or what?? thanx.

  11. I am a mac user. I send zip files daily to my office with multiple photos. Lately they have been telling me that they can not see all of they files that are in the folder I am sending. It works perfectly to everyone else I send it to except on their computer. Anyone else had this issue?

  12. just something that might make it easier for all.

    you can creat a self extracting file (EXE, application) for any type of file

    simply hit Start__>run__>type in “iexpress.exe”

    and follow along the instruction from their.

    i think its on most windows machines.

    Marc

  13. How do i send a very large folder of mp3 itunes songs to my friend via email – i cant sit there for hours emailing each track! Ive put all of them into one folder onto my desktop but when i go to open it it asks for a single track to attach rather than the whole folder..

  14. Too bad about the .zip method, have 1000’s of mp3s on my hd. taking up too much room.
    Thanks Marc for the IExpress 411. First I’ve seen that, although I’ve seen tools designed to make .exe’s from other formats. And there it is right in windows! I’ll have to try it out sometime (with junk files to start)!

    John N.

  15. I wish to send about 30 songs to a friend and I used iexpress and put a whole lot of music in and it worked but when I closed it I cannot see the file and when I open it again and put the name of the file in it says it does not exist and to create a new file – it must be somewhere where do I look? can you help please I am using Vista

  16. i just read all these comments and.. i feel sorry for you XD i cant beleive these people even know how to fill out this forum im typing in…

  17. Zipping files that are already in a compressed format (jpg, for example) may save space, but not due to compression savings. Files are allocated in “chunks”. Any space that is left over in the file’s last chunk is effectively wasted space. The more files, the more wasted space. If you combine all of these files into one archive (zip or otherwise) then you have only the wasted space at the end of the one archive file instead of the waste in each of the component files. However, you have to weigh the space saving against the inconvenience of accessing the files through the archived format. Also, there is a certain amount of space taken up by the zip file header.

  18. It SHOULD be possible to compress an mp3 file to a much smaller size (in a lossless format). Yes an mp3 file is “compressed” but for a standard constant bitrate file each second of sound is allocated a fixed number of bytes.

    Most music files will contain repetition, eg a riff or chorus that appears multiple times in the file, and therefore it should be possible, given the right algorithm, to compress out this duplication.

    Why this doesn’t happen in reality I guess is that the standard compression algorithms either do not detect this duplication for whatever reason or simply do not deal with it.

    Maybe someday someone will come up with a totally lossless file compression algorithm for mp3s and even wav, although by then we may all have switched to lossless compression in the first place.

  19. @Earl Purple
    Here’s the problem with this theory. Lossless compression works by storing symbols using the least number of bits necessary to represent the original data. To put it another way, the data is represented in the compressed file in a highly complex mathematical algorithm that requires less space than the original data. JPGs, GIFs, MP3s, etc, already store their data in a method extremely similar to this. In fact, it has been shows that the Huffman algorithm used in MP3 is a modified version of LZW, an extremely effecient and highly popular compression method.
    MP3s specifically store music NOT as a compressed waveform, but as a series of coefficients that represent the individual frequencies, or notes, that were present in the original waveform. In theory, the coefficients would take exactly the same amount of data to store, but MP3 “cheats” in that it throws away any of the coefficients that it thinks people would not be able to hear anyway (perceptual modeling). It then compresses the remaining data as much as possible into the Huffman compression format, and then breaks up the data into individual “frames” that can be played back by MP3 players. In order to make the MP3 file smaller, you can throw away more and more of the frequencies, but you WILL start to hear the degradation in quality rather quickly.
    JPGs, and MPGs/AVI/etc, have similar concepts behind them.
    You mentioned that it should be possible to remove the repetition in the riffs, and repeated parts to save more space, but consider this: if you play the same note with an instrument one million times, you will NEVER be able to find two identical waveforms in them! There is far too much randomness to the data for that type of compression to be possible. And it would make no difference if you found two “similar” notes, and somehow subtracted out the differences so you could save the space of the actual second note and just store the tiny differences between the notes. There is so much randomness to the differences that it would take essentially the same amount of space in the file to do that.
    Actually, MIDI does something similar to this, instead of storing the sound from the instruments, it just stores what notes are played and recreates that sound upon playback. It is NEVER going to sound like the “real thing” because you aren’t storing the real waveform, just the information that there was a note played.
    If you would like more info on how compresion works, check out Wikipedia’s article: http://en.wikipedia.org/wiki/Data_compression
    -cheers

  20. Earl:

    All those riffs that you think could be replaced by one copy, cannot. There are differences in the playing of them every time, even though the sheet music might be the same.
    Consider the Smoke on the Water riff. Even on the sheet music, it has variations, then you add in the ones that come from a real person playing it.

    The problem with your other theory of a loss less way to compress MP3s is that the MP3 has already created losses and if you could find your magical program, you are just copying the losses. However, as Leo tried to explain (and did a much better job than most of the explanations I have seen), a compessed file looks to another compressor as relatively random stuff that doesn’t compress well.
    Don’t ever expect that any program will compress any already compressed (even a lossless) file. FLAC compression is lossless and does a great job in compressing audio files that were not already compressed by something else. You could compress them more by converting them to an MP3 but what that would really be doing is restoring the uncompressed audio and throwing out parts of it that you think are not really noticeable as it compresses it again.

    If you want to experiment with something more obvious than audio (a lot of the changes are very subtle), try using a program where you can convert a photo to jpg and adjust the compression. Pick a photo with some subtle shading of similar colors (like sky) or for a shocker, use some line art (like a screen capture of this page) to see how much the compression looses or modifies the origonal.

  21. The algorithm described in the article is lossless, the ten asterisks are returned intact. Years ago pondering file compression I figured something like that independently. (I have re-invented the wheel hundreds of times, can’t help it) I do a lot of intense graphics work, and I always save my files as bitmaps. (Or vector graphics if they are of that nature) but never as jpg. (Unless I get careless and do it by mistake, which happens sometimes) Disk space is not that precious to me anyway, and a lot of times I will attach a bmp to an email, then wonder if the recipient will wonder why I didn’t send a jpg. If you save a 256 color image as a jpg and then test the count of colors in the picture, it will be in the tens of thousands. If you cut a figure out of the background by filling the backgournd with white, then save the cut out figure as a jpg, and later try to paste that cut out figure over a new background, it won’t work, because the white will have become a hundred or more ‘shades’ of white. I am now curious enough to test a compression program like 7zip on a bmp file, although I doubt I would use it even if it results in high compression and no loss of data. Maybe for archiving some old files to DVDs or something…. Thanks for giving me something to think about. It’s great being a geek in the company of geeks. 🙂

  22. @Digital Artist
    .PNG format is a lossless format for saving photos in the same way .FLAC is a lossless format for compressing music. Now that storage and bandwidth are getting cheaper, many websites are using .PNG photos as they have a higher quality. :PNG format is a universal format which is understood by all browsers, image viewes and editors.

  23. ZIPping several less used files has a different benefit. It reduces the folder and file names clutter. And reduces the number of file handles (or inodes in Linux). File handles or inodes are the index entries for a file on the file system. And, these are not unlimited. Moreover, it can decrease the computer’s performance/response when searching or using file explorers.

    So, if you have many files that you use rarely, it is good to organize them in folders and ZIP each folder and then delete the files. Also, when you need to store a large number of files on a USB external hard disk, it reduces the backup time. Storing one or few zip files takes substantially lesser time than storing thousands of files.

  24. Hello,
    I have a .mov file I would like to send to a auto service person but it says that it is to big to send. I Zipped it (Zip7) but now I’m getting notes that I should send it to the iCloud. But how is this person supposed to get it if I do that? Now I have also heard of using a URL address to send to the recipient. But I don’t know how to do this action. I follow instruction well so if someone could step me through one of the procedures, it would be greatly appreciated.
    I await your reply

  25. >So there’s typically no space-saving advantage to ZIPping a photo, a movie, or an MP3.

    Incorrect. Photos, movies, and music are compressed but they still have to “seem normal” to the human eye & ear. That means the files are not fully-compressed, and there’s still room for ZIP to compress the files even further………. for example the MP3s on Rifftrax are ZIPPED downto 60% their standard size.

    • In some exceptional cases zipping an mp3 or other compressed media file might save some space, but in the vast majority of cases, the added compression is minimal or even worse, the file is often made larger by zipping it.

  26. Hello,
    What is the effective format for compressing video files? …
    I am a Linux user, I have tried all formats for compressing videos stored on my pc and none of them compresses.

  27. I was thinking of doing this to potentially save the unused parts of incomplete blocks on the drive. I think it could matter for an unimaginable number of small files. If you could just take up all of the blocks in one bigger file potentially not compressing but just storing this could maybe work.

  28. I want to store various folders onto an external hard drive. The folders (or projects) only contain pdf files. Would storing them as zip files be more efficient?

    • Similarly to .mp3 files, the savings would not be significant as .pdf files are already compressed. And as with .mp3 files, it might even result in larger file sizes.

Leave a reply:

Before commenting please:

  • Read the article. Comments indicating you've not read the article will be removed.
  • Comment on the article. New question? Start with search, at the top of the page. Off-topic comments will be removed.
  • No personal information. Email addresses, phone numbers and such will be removed.
  • Add to the discussion. Comments that do not — typically off-topic or content-free comments — will be removed.

All comments containing links will be moderated before publication. Anything that looks the least bit like spam will be removed.

I want comments to be valuable for everyone, including those who come later and take the time to read.