An optimizer trades bytes for pixels, and the trade is measurable. On one 3,019,770-byte test photo (3,000 × 4,000, no metadata), saving at quality 85 with the encoder’s optimize flag cut the file to 1,638,783 bytes — 45.73% smaller — while 53.834% of pixels changed and the largest single-pixel shift was 58 of 255 levels.
Three findings settle most arguments: pushing quality past 95 makes the file bigger than the one you started with (quality 96 = 107.07% of the original); three levers cut bytes without touching a single pixel (progressive −7.5%, optimize flag −1.6%, metadata strip 22,217 bytes on a real camera file); and running the same optimizer twice adds almost nothing — the second pass moved 0.042% of pixels by more than 10 levels. The first pass is the expensive one.
Every optimizer on the first page of results — the browser-based compressors, the Mac app, the CDN service, the store listing — sells the same sentence: smaller file, same-looking image. The sentence hides the machinery. Under the hood there are exactly four levers, and they are not equally innocent.
The tool pages show you sliders. They do not show you what a slider position costs on your file, in pixels and in bytes. That is the gap this page measures, on two real files, with one encoder, start to finish.
One photo (3,000 × 4,000, 3,019,770 bytes), one encoder (Pillow 13.0.0, default chroma subsampling), quality 30 through 98. “Changed” is the share of the 12,000,000 pixels whose decoded value differs from the original; “>10 levels” is the share that moved by more than 10 of 255 steps.
| Quality | Bytes | % of source | Max shift | Changed | >10 levels |
|---|---|---|---|---|---|
| 30 | 699,091 | 23.15% | 108 | 65.033% | 17.082% |
| 40 | 803,903 | 26.62% | 107 | 98.329% | 15.097% |
| 50 | 902,908 | 29.90% | 102 | 63.134% | 13.597% |
| 60 | 1,010,111 | 33.45% | 96 | 62.289% | 12.150% |
| 70 | 1,175,396 | 38.92% | 89 | 93.512% | 10.358% |
| 80 | 1,453,932 | 48.15% | 68 | 56.263% | 7.816% |
| 85 | 1,666,969 | 55.20% | 58 | 53.834% | 5.470% |
| 90 | 2,191,027 | 72.56% | 48 | 50.218% | 3.711% |
| 95 | 2,993,036 | 99.11% | 38 | 28.753% | 0.400% |
| 98 | 3,884,154 | 128.62% | 34 | 32.319% | 0.341% |
Bytes fall smoothly as quality drops. Pixel damage does not. At quality 40, 98.329% of pixels move while at quality 50 only 63.134% do — the aggressive setting flattens whole regions into blocks (a large shift on fewer pixels), the middle settings dither boundaries (a small shift on more pixels). Anyone quoting a single “percent of pixels changed” number without the quality setting is quoting noise.
Zoom into the top of the ladder: quality 90 lands at 72.56% of the source, 92 at 80.92%, 94 at 92.58%, 95 at 99.11%. Then it flips. Quality 96 is 3,233,373 bytes — 107.07% of the original — and quality 98 is 3,884,154 bytes, 128.62% of the file you fed in.
A slider dragged to “maximum quality” can hand back a file 28.62% larger than the one you uploaded. The reason is arithmetic, not mystery: a JPEG stores what the first encoder chose to keep. Re-encoding at a higher setting spends bytes re-describing detail the original already discarded — including its compression noise. If the goal is a smaller file, the useful range ends around 90–92, and everything past 95 is paying to grow.
Most tools never mention it. At quality 85, the same photo encoded three ways: 4:4:4 (full colour resolution) came out at 2,167,288 bytes, 4:2:2 at 1,855,445, and 4:2:0 — the default in a long list of encoders — at 1,666,969. That is 23.09% smaller than 4:4:4 (1 − 1,666,969 ÷ 2,167,288), bought by storing colour at half resolution in both directions. The pixel cost: the largest single-pixel shift rose from 46 levels (4:4:4) to 58 (4:2:0), and the share of pixels more than 10 levels off went from 2.039% to 5.470%. The setting that decides this is usually buried or absent from the interface, which makes it the one lever worth asking your tool about.
Not every byte saving is a trade. These three are free, in the literal sense: the decoded image is bit-identical.
Read that last number honestly. Metadata is real, and on a small web graphic 22 KB matters, but on a photo the bytes live in the pixels, not the tags. Tools that advertise “removes metadata to save space” are solving the small problem.
Every optimization page tells you to resize first. Here is what that advice is worth in bytes on the test photo, resized with a high-quality filter and re-saved at quality 85:
| Output | Bytes | % of source | Max shift | Changed | >10 levels |
|---|---|---|---|---|---|
| Half — 1,500 × 2,000 | 529,048 | 17.52% | 132 | 47.040% | 10.584% |
| Quarter — 750 × 1,000 | 150,920 | 5.00% | 172 | 54.291% | 19.486% |
Halving the dimensions cut 82.48% of the bytes — more than the entire quality ladder from 30 to 98 can offer at full size. A photo displayed 800 px wide does not need 3,000 px of width; the extra pixels are bytes you ask every visitor to download for nothing. The pixel cost is real and visible if you zoom (max shift 132 levels at half size), which is why the order matters: resize to the display width first, then compress, instead of compressing a file that was always too big.
Same photo, same encoder, quality 80 where the format is lossy. The last column is the honest one: how far the decoded pixels sit from the original.
| Format | Bytes | % of JPEG q80 | Pixels vs original |
|---|---|---|---|
| JPEG q80 (baseline) | 1,453,932 | 100% | 56.263% changed, max 68 |
| WebP q80 (lossy) | 1,026,076 | 70.6% | 64.229% changed, max 51 |
| AVIF q80 (lossy) | 1,362,959 | 93.7% | 64.196% changed, max 44, 1.853% >10 levels |
| PNG-8, 256 colours | 2,763,149 | 190.0% | 64.761% changed, max 89 |
| GIF, 256 colours | 3,378,730 | 232.4% | 64.761% changed, max 89 |
| WebP lossless | 7,659,392 | 526.8% | 0 changed |
| PNG lossless | 10,643,555 | 732.0% | 0 changed |
On this photo, lossy WebP at q80 was 29.4% smaller than JPEG q80 with a lower maximum shift (51 vs 68 levels). AVIF was only 6.2% smaller than the JPEG, but it left just 1.853% of pixels more than 10 levels off — the cleanest image per byte in the set. The traps are the lossless modes: lossless WebP measured 28.04% smaller than lossless PNG (7,659,392 vs 10,643,555 bytes), which lines up with the published figure that lossless WebP is typically about 26% smaller than PNG (MDN, quoted as a source, not our measurement) — but both lossless modes are multiples of any lossy file. And a 256-colour GIF of a photo is 2.32× the JPEG with exactly the palette damage of PNG-8; it is the wrong tool wearing a familiar name.
Two published claims worth quoting with their sources, because our single file sits inside one range and below the other: MDN states that “lossy WebP images are on average 25–35% smaller than JPEG images of visually similar compression levels” (we measured 29.4% on this photo), and that “lossy AVIF images are around 50% smaller than JPEG images” (we measured 6.2% — treat the published figure as a best case across many images, not a promise). On browser support, MDN lists AVIF as Chrome 85, Edge 121, Opera 71, Firefox 93, and Safari 16.1; older browsers need a JPEG or PNG fallback. Both citations are documentation, not our own tests.
Feed the quality-80 output back in at the same setting and the file barely moves: 1,453,932 bytes in, 1,453,769 bytes out. A hundred and sixty-three bytes. Whatever “optimize it twice” is supposed to buy, it is not in the byte count.
The pixels move more, just not where you would see it. Against the first generation, 17.962% of pixels changed — but only 0.042% moved by more than 10 of 255 levels. Against the untouched original, the second generation is worse than the first on both counts (max shift 84 vs 68, and 8.798% vs 7.816% beyond 10 levels), and the extra damage is the small kind.
That shape — one expensive encode, then cheap ones — lines up with a repeated-save test scored by a perceptual metric: the drop lands on the first save, and saving again at the same setting barely registers. Two setups, one direction. The percentages belong to this photo; the order of costs is the part that travels.
Read it practically. A file that has already been through an optimizer gains next to nothing from a second one, in bytes, and pays a small pixel tax. A file that has not: the first pass decides how that picture looks from then on.
Two files, one encoder, one Windows machine. The first is a 3,000 × 4,000 JPG, 3,019,770 bytes, no EXIF — it carries the ladder, the subsampling comparison, the three pixel-free levers, the resize table, the format table and the second-pass test. The second is a camera original, 3,936 × 2,624, 8,692,218 bytes with 22,213 bytes of EXIF, used only for the metadata strip. Encoder: Pillow 13.0.0, defaults except where a setting is named. Every pixel figure is a full-frame comparison of decoded output against the decoded original; a pixel counts as changed when any channel differs by one level or more.
Not tested, not claimed: what any third-party optimizer does to your file — those pages describe their own engines, and we ran none of them; other photos, whose exact percentages will move with detail and noise; browsers and phones, whose resampling may differ from Pillow’s; AVIF and WebP beyond the single quality point in the table; and whether the result looks good to a human eye, which no table settles.
Yes, and the amount is measurable. Every save below quality 100 re-quantizes the 8×8 blocks. On our test photo, quality 85 changed 53.834% of pixels and moved 5.470% of them by more than 10 of 255 levels; quality 80 changed 56.263% and moved 7.816%. Whether that reads as damage depends on the picture — a smooth sky bands before a busy street does. A lossless PNG export of the same photo changed 0 pixels.
The browser-based ones usually are, and there is a structural reason: the encoding runs on your machine, so there is no server bill to pass on. What “free” normally bounds is size — a per-file cap, a batch limit, or an account before the watermark comes off. Server-side optimizers — CDNs, APIs, site plugins — charge because they store and re-serve the file. Read the limits line, not the price tag.
Because bytes are time. The same scene as a 3,019,770-byte original and as a 529,048-byte half-size export arrives at different speeds, and on this test the half-size file was 82.48% smaller. It matters most for the image that paints first, since that download sits on the critical path. It also matters for mobile data and for whatever you pay per gigabyte. It does not, by itself, decide where a page ranks — speed is one input among many.
In this order: resize to the width the layout actually renders; pick a format your audience’s browsers can read; set quality 80–85; switch on progressive and the optimize flag; strip metadata if it is sensitive or the file is small. Run in that order on the test photo, the sequence ended at 1,638,783 bytes from 3,019,770 — 45.73% smaller — with 5.470% of pixels more than 10 levels off and a worst-case shift of 58.
The second save adds little. First pass at quality 80 against the original: 56.263% of pixels changed, 7.816% beyond 10 levels. Second pass against the first: 17.962% changed, but only 0.042% beyond 10 levels, and the file came out 163 bytes smaller. The first encode is the expensive one. After that the picture is mostly re-describing what it already is.