Does compressing an image reduce quality?
Sometimes, and much less than people think — so we measured exactly how much, including what happens when you re-save the same JPEG fifty times.
By Free Image Lab ·
The short answer
Compression is not one thing. There are two kinds, they behave in opposite ways, and almost every argument about this comes from people talking about different ones.
Lossless compression stores the same pixels in fewer bytes. Nothing is discarded and nothing changes. PNG works this way, and so does a ZIP file.
Lossy compression throws away detail your eye is unlikely to miss, then stores what remains. JPEG works this way. The discarded detail is gone permanently.
So yes, JPEG compression reduces quality. The useful question is by how much, and the honest answer is that at sensible settings it is much less than the internet suggests, and it mostly happens once rather than every time.
Which of your files is which
- Lossy: JPG, JPEG, WebP (usually), AVIF, HEIC
- Detail is discarded at save time. Excellent for photographs, where the discarded detail really is invisible. Poor for screenshots, logos and anything with text or hard edges, where it produces visible smearing around the edges.
- Lossless: PNG, WebP (in lossless mode), GIF, BMP, TIFF
- Every pixel survives. Files are far larger for photographic content. Right for screenshots, diagrams, logos and anything with transparency.
Changing the extension is not converting
Renaming photo.jpg to photo.png does not make it lossless. It is still JPEG data with a misleading name, still carries every artifact from the original save, and some software will now refuse to open it. Converting means re-encoding, which is a different operation.
What we measured
Most articles on this subject give you adjectives. We would rather give you numbers, so here is the method, stated plainly enough that you could repeat it.
A 1600 × 1200 test image was built to behave like a photograph: smooth gradients, soft out-of-focus blobs, film-style grain, and a block of hard-edged shapes and serif text, since that last part is what lossy compression handles worst. It was then encoded at a range of JPEG quality settings, decoded again, and compared pixel by pixel against the original.
“Average difference” below is the mean change per colour channel on the 0–255 scale. “Worst pixel” is the largest single change anywhere in the frame.
| JPEG quality | File size | Average difference | Worst pixel |
|---|---|---|---|
| 100 | 1,815 KB | 0.44 | 5 |
| 95 | 849 KB | 1.76 | 53 |
| 90 | 588 KB | 3.13 | 62 |
| 85 | 429 KB | 4.09 | 71 |
| 80 | 330 KB | 4.66 | 74 |
| 70 | 217 KB | 5.26 | 82 |
| 60 | 161 KB | 5.61 | 81 |
| 50 | 127 KB | 5.85 | 87 |
| 30 | 65 KB | 6.45 | 104 |
| 10 | 20 KB | 7.86 | 147 |
The same image saved as PNG, losing nothing, came to 4,143 KB. That is seven times the size of the quality-90 JPEG, which is the clearest possible argument against using PNG for photographs.
Two honest limits on these numbers. They come from one synthetic image and one encoder, so treat the shape of the curve as the finding rather than any individual figure. And average pixel difference is a crude stand in for what your eye notices: it under-reports the blocky artifacts that make heavy compression look bad, which is why the “worst pixel” column climbs steadily even where the average has flattened out.
The quality 100 trap
Look at the first two rows again. Going from quality 100 to quality 90 removed two thirds of the file size and moved the average pixel by about 2.7 points out of 255, roughly one percent.
Quality 100 is not lossless. It is the same lossy process applied as gently as the format allows, at the point where the format has stopped being efficient at all. You pay three times the bytes for a difference you will not see on any screen.
If you truly need zero loss, the answer is a lossless format, not the top of the JPEG dial. If you are producing something for the web, quality 80 to 85 is the range where most of the size disappears and almost none of the visible quality does.
What happens if you re-save the same JPEG over and over
This is where the common advice is not just imprecise but wrong. The familiar warning is that every save degrades a JPEG further, like photocopying a photocopy, until it collapses. So we tested it: one image, saved at quality 80, then decoded and re-saved at quality 80 fifty times in a row.
| Save number | File size | Difference from the original | Change since the previous save |
|---|---|---|---|
| 1 | 329.9 KB | 4.658 | — |
| 2 | 329.6 KB | 4.704 | 0.113 |
| 3 | 329.6 KB | 4.722 | 0.058 |
| 5 | 329.5 KB | 4.743 | 0.030 |
| 10 | 329.4 KB | 4.757 | 0.003 |
| 25 | 329.4 KB | 4.758 | 0.000 |
| 50 | 329.4 KB | 4.758 | 0.000 |
The first save accounted for about 96 percent of all the damage done across fifty saves. By the tenth save the image was barely moving, and from the twenty-fifth onwards it stopped changing altogether: the final column is a true zero, not a rounded one. Saves twenty-five through fifty produced a pixel-for-pixel identical image.
That is not a fluke, it is how the format works. JPEG rounds the image onto a fixed grid of values. Once an image has been rounded onto that grid, rounding it again with the same settings lands on the same values, so it reaches a stable point and stays there.
The condition that makes this true
Same quality setting, same dimensions, every time. Change either between saves and you are rounding onto a different grid, which starts the damage again. That is why generation loss is real for a picture that gets resized, re-cropped and re-shared repeatedly, and effectively absent for one that is simply opened and saved.
Worth knowing too: copying, moving, emailing, backing up or uploading a JPEG does not re-encode it at all. Those operations move bytes around and cost you nothing. Only opening it in an editor and saving again re-encodes.
Where PNG fits
We ran the same experiment on PNG: save, decode, re-save, twenty times over. The result was exactly what the format promises and worth stating precisely.
- Pixel difference after twenty round trips: zero.
- File size after twenty round trips: 4,242,026 bytes, identical to the first save, byte for byte.
PNG compression genuinely costs nothing in quality. What it costs is space, and for photographic content it costs a great deal of it, as the seven-fold difference above shows.
There is one way to lose data in a PNG, and it is worth knowing because some tools do it silently: reducing the colour palette. Cutting an image from millions of colours to 256 makes the file dramatically smaller and is genuinely lossy. Our PNG compressor does this, and it shows you the colour count it is using so the trade is visible rather than hidden.
What to actually do
- Photographs for the web
- JPEG or WebP at quality 80 to 85. Below 70 the artifacts start becoming visible on screens with any detail in them.
- Screenshots, logos, diagrams, anything with text
- PNG. Lossy compression smears the edges of text, and it is the one failure mode people reliably notice.
- An image that is simply too large in megabytes
- Check the dimensions before reaching for the quality slider. A 4000 pixel wide photo displayed in a 800 pixel column is carrying five times the pixels it needs, and resizing removes that weight with no compression artifacts at all. We measured how much this saves, and the other four reasons a file balloons, in why is my JPEG so big.
- Something you will keep editing
- Work in a lossless format and export to JPEG once, at the end. This is the advice behind the “never re-save a JPEG” warning, and it is sound, just for a narrower reason than usually given: it is the resizing and re-cropping along the way that hurt, not the saving itself.
Check it on your own image
Our JPG compressor shows the before and after size as you move the quality slider, so you can find the point where your particular image stops looking right. It runs in your browser, so nothing is uploaded and you can try it as many times as you like.
Frequently asked questions
- Does compressing an image reduce quality?
- Lossy compression, which is what JPEG and WebP normally use, does discard image data and cannot get it back. Lossless compression, which is what PNG always uses, reduces file size without changing a single pixel. So the answer depends on the format, and even for JPEG the loss at sensible settings is far smaller than most people expect.
- Can you compress a PNG without losing quality?
- Yes, and that is the only thing PNG does. PNG compression is lossless by design, so a compressed PNG decodes to exactly the pixels you put in. We re-saved the same PNG twenty times in a row and the final file was byte-for-byte identical to the first, with zero pixel difference. The one thing that does lose data is reducing a PNG's colour palette, which is a separate choice some tools make on your behalf.
- How many times can you compress a JPEG before it falls apart?
- Far more than the common advice suggests, as long as you do not change the quality setting or the dimensions in between. We re-saved a JPEG fifty times at the same quality. The first save caused about 96 percent of all the damage, and by the twenty-fifth save the image had stopped changing completely, because the compression had reached a fixed point. Resizing or changing quality between saves is what actually causes visible generation loss.
- Should I save JPEGs at quality 100?
- Usually not. In our measurements quality 100 produced a file three times larger than quality 90, for an average pixel difference of about one part in a hundred. Quality 100 does not mean lossless, it just means the lossy process is applied gently while the file stops being efficient. If you genuinely need zero loss, use a lossless format rather than turning the JPEG dial to the top.
- Do pictures lose quality every time you save them?
- Only if they are in a lossy format and something actually changes between saves. Copying, moving, emailing or uploading a JPEG does not re-encode it, so those cost nothing at all. Opening it in an editor and saving again does re-encode it, and that first re-encode is where nearly all the loss happens.
Tools for this
Free, and everything runs in your browser.