Image
Saving an image ten times over: when quality really degrades (and when it does not move)
It is advice repeated everywhere: do not save a JPG several times, it loses quality each time. The idea is right in principle, since JPG is a lossy format. But how much? And under what conditions? To find out, we put the same photo through ten successive conversions, in several scenarios, measuring its fidelity to the original at each step. Some results surprised us.
What generation loss means
A generation is a copy of a copy. With a lossless format such as PNG, the tenth generation is strictly identical to the first: every pixel is restored as it was. With a lossy format such as JPG or WebP, each encoding simplifies the image to save space, and you would expect those simplifications to add up from one copy to the next.
In practice, this happens when you edit a photo and save it again, when an image goes through several apps that each recompress it (messaging, social networks, presentation software), or when you convert it from one format to another as needs change.
Our protocol
We started from a 2048 × 1152 pixel beach photo, taken with a smartphone and saved as JPG (529 KB), rich in fine texture. Each generation is produced by FFmpeg with FileXvert's settings, from the previous generation, and compared with the original using the SSIM index: 1 means identical, above 0.99 the difference is invisible to the naked eye, and below 0.97 flaws appear when zooming in.
We tested six scenarios: three JPG qualities repeated identically, a repeated WebP, alternating WebP and JPG, and alternating between two JPG qualities.
The results
Here is the fidelity measured after the first, second, fifth and tenth generation.
| Scenario | 1st | 2nd | 5th | 10th |
|---|---|---|---|---|
| High-quality JPG, repeated (no reduction) | 0.998 | 0.998 | 0.998 | 0.998 |
| Medium-quality JPG, repeated (balanced) | 0.995 | 0.995 | 0.995 | 0.995 |
| Compressed JPG, repeated (smallest size) | 0.985 | 0.985 | 0.985 | 0.985 |
| WebP, repeated (balanced) | 0.983 | 0.979 | 0.976 | 0.974 |
| Alternating WebP then JPG | 0.983 | 0.982 | 0.969 | 0.956 |
| Alternating two JPG qualities | 0.995 | 0.961 | 0.960 | 0.960 |
| PNG, repeated (lossless) | 0.995 | — | 0.995 | — |
The PNG value, slightly below 1, is not a loss: the original photo stores its colours at half resolution, like every JPG, and converting them into full pixels introduces a constant rounding difference. That figure never moves afterwards, whatever the generation.
Lesson one: the same setting barely degrades anything
This is the most counter-intuitive result: a JPG re-saved ten times with exactly the same encoder and the same quality stays stable. SSIM only moves in the sixth decimal place, and the size stays the same to within a few bytes.
The explanation lies in how JPG works. The image is cut into 8 × 8 pixel blocks, transformed into frequencies, then rounded according to a grid set by the quality. If you re-encode the image with the same grid, the already rounded values land exactly on it: there is almost nothing left to round. The loss happens at the first generation, not the following ones.
This result does assume precise conditions, though: the same software, the same quality, and no change to the image between two saves. That is rarely the case in real life.
Lesson two: what really damages an image
As soon as one of those conditions changes, degradation becomes real and cumulative:
- Changing quality: going from a medium-quality JPG to a more compressed one, then back, drops SSIM to 0.961 from the second generation. That is worse than compressing the original directly at the strongest level (0.985): the two rounding grids work against each other.
- Changing format: alternating WebP and JPG degrades the image at every step, down to 0.956 at the tenth generation. Each format simplifies the image according to its own logic, and those simplifications do not line up.
- WebP on its own degrades slowly but surely, from 0.983 to 0.974 over ten generations: its more elaborate encoder does not land exactly on its own rounding.
- Resizing: shrinking a photo then scaling it back to its original size, as a balanced JPG, gives an SSIM of 0.957. Details lost when shrinking never come back.
Good habits
These measurements translate into a few simple rules:
- Always keep the original, and start from it for each new version rather than converting a copy of a copy.
- Choose the final format once and for all; avoid going back and forth between JPG, WebP and other lossy formats.
- For an image you will edit often, work in a lossless format (PNG, or your software's native format), and only export to JPG or WebP at the end.
- If you need to reduce an image's size, do it in a single step, at the level you want, from the original.
- Beware of invisible chains: a photo sent through a messaging app, downloaded, published then shared again has often been recompressed several times, by different software.
With FileXvert, each conversion starts from the file you drop: by dropping the original rather than an already converted copy, you limit the loss to a single generation.