Wirebook › Bonus lesson
Why does zipping photos barely make them smaller?
You zip a folder of holiday photos and the zip is almost the same size. You zip a letter and it shrinks a lot. Why? Guess what happens when four very different things go into the same suitcase, then pack them with a real (tiny) compressor and see. Nothing you try leaves your browser.
Why zipping photos barely works
A zip file (and cousins like gzip) is lossless compression. It scans for repeated patterns and writes a short recipe instead of copying every byte. A chorus of “LA LA LA” is a dream: the recipe is “LA, this many times”. Ordinary writing shrinks too, because words such as “the” keep appearing. The original letter is still there when you unpack.
A photo from a camera is usually already packed, as JPEG. That first packing was lossy: the camera threw away detail you are unlikely to notice (tiny colour wobbles, high-frequency sparkle) so the file would fit on the card. What is left looks almost random to a second packer. Zipping it is like sitting on a suitcase that is already vacuum-sealed — there is nothing left to fold, and the zip’s own label can even make the file a few bytes larger.
TV snow is the extreme case: true randomness has no pattern at all. The packed file still needs a small header, so it grows a little.
A few more honest details
- PNG versus JPEG. A screenshot or a picture with large flat colours often shrinks well as PNG (lossless). A camera photo usually does not, which is why cameras pick JPEG.
- Already packed twice. ZIP, gzip, MP3, AAC, H.264, WebP and AVIF are all compressors. Running a second lossless packer over any of them rarely helps.
- This page’s packer is tiny. It only knows short repeating choruses, runs of the same letter, and a word dictionary. Real zip is cleverer (it finds phrases, not just words) but the rule is the same: no pattern, no saving.
Grown-up twins: Tooltern’s guides on lossless vs lossy compression, why a ZIP can come out larger than the files you put in, gzip vs ZIP, why zipping photos barely makes them smaller and shrinking a whole batch without uploading, plus the in-browser image compressor (it redraws each photo on your device, so hidden location tags are dropped). Sister lesson: why a video call goes blurry on a slow connection.