How image compression actually works, without the maths
Why a photo shrinks by 80% and a screenshot barely moves, why the second pass is always worse, and what "quality 85" is really doing.
Published 25 Jul 2026 by the FlipMyFile team
Compression feels like magic until you know the trick, and then it becomes obvious why some files shrink dramatically and others refuse to budge.
Lossless: finding repetition
Lossless compression writes the same information more briefly. If a row contains two hundred identical white pixels, store "white × 200" instead of listing them. Rebuild it later and you get back exactly what you started with.
This is why PNG is brilliant on screenshots — vast areas of identical colour — and nearly pointless on photographs, where practically no two neighbouring pixels match. There is simply no repetition to find.
Lossy: throwing away what you will not miss
Lossy compression exploits the limits of human vision. Two facts do most of the work: we notice changes in brightness far more than changes in colour, and we are poor at spotting fine detail inside busy areas.
So JPG stores colour at half resolution while keeping brightness at full resolution — and almost nobody can tell. Then it breaks the image into blocks and discards the finest detail in each one. The quality setting is essentially "how much detail do we keep".
Why PNG compression is different
When a tool offers to "compress" a PNG and reports a 70% saving, it is usually not doing lossless compression at all. It is reducing the number of distinct colours in the image to at most 256, then storing them as a palette.
On a logo or a screenshot with a dozen colours, this is invisible and the saving is enormous. On a photograph with tens of thousands of colours, it introduces visible banding in every gradient. That is why the same button gives a wonderful result on one image and a poor one on another.
Why the second pass is always worse
Compressing an already-compressed file cannot recover the detail that was removed the first time — it can only remove more. Meanwhile most of the easy savings are already gone, so you pay in quality and receive very little in bytes.
What mozjpeg does differently
All JPG encoders produce files that any decoder can read, but they differ in how hard they work to choose the encoding. mozjpeg spends more processing time picking better options and typically produces files 5–15% smaller than a standard encoder at identical visual quality.
It is free quality — the only cost is a little CPU time on our side rather than yours. Our JPG tools use it by default.
The practical summary
- Photographs: lossy formats win by a wide margin. JPG or WebP.
- Flat graphics and screenshots: lossless or palette-based. PNG or WebP.
- Never compress the same file twice. Always work from the original.
- If the saving is tiny, stop — you are trading quality for nothing.
Try it now
The tools this article talks about. Free, no signup.