Skip to content

How to tell if compression hurt your photo's quality

How to judge compression quality with a number, not just a thumbnail.

The problem with eyeballing a thumbnail

The usual way people judge whether compression "went too far" is squinting at a small preview and guessing. That works for obviously broken results (heavy blotching, blocky edges), but it's unreliable for the more common case: a moderate setting where the loss is subtle at preview size but might matter at full size, or vice versa. A number gives you something consistent to compare across settings instead.

What PSNR actually measures

PSNR (Peak Signal-to-Noise Ratio) measures, in decibels, how far a compressed image's pixels drift from the original's, pixel for pixel. It's computed by re-decoding the compressed result and comparing it directly against the source. Higher means the compressed version stayed closer to the original. It's a standard objective metric, not a subjective rating; the same input and setting always produces the same score.

Reading the dB number

As a general rule of thumb: 45dB and above is visually identical to the original for most images. 35–45dB is very good, with no loss most people would notice. 30–35dBis good, with only minor loss visible on close inspection. 25–30dBhas noticeable loss, and below 25dB is significant loss. These are general guides, not guarantees for every image. Treat a borderline score as a reason to look closer, not a final verdict.

Why the same score can look different on different photos

PSNR measures pixel difference, not what a human eye is likely to notice. A busy, high-detail photo (foliage, texture, fine patterns) can hide considerably more compression at a given score than a flat, simple graphic, because human vision is naturally worse at spotting loss buried in complex detail. Two images at the same dB score can look meaningfully different in practice, which is why the score is a starting point for comparison, not a substitute for looking at the result yourself when a decision is close.

A practical way to use it

Rather than picking one quality setting and hoping, save a few versions at common quality levels, score each against the original, and compare file size against quality side by side. ImageMagick does the scoring from the command line: magick compare -metric PSNR original.png compressed.jpg null:prints the dB value. The smallest file size that still clears a "very good" threshold (roughly 35dB or higher) is usually a solid starting point: real savings, without crossing into territory where loss becomes noticeable. From there, inspect the actual result yourself before committing to it.

PSNR versus a straight before/after comparison

These solve two different problems. A before/after slider is for two images you already have. Drag between them and see the difference directly, useful when you want to confirm a specific result looks right. A quality-level comparison starts from one image and answers a forward-looking question: at what setting does this photo start to lose quality? Use the comparison to choose a setting, then the before/after slider in the image compressor to double-check the result.

Quality comparison questions

What's the difference between comparing two images and comparing compression levels?

Comparing two images (a before/after slider) answers "how different are these two specific files?" Comparing compression levels answers a different question upfront: "at what setting does this particular photo start losing quality?" You answer it by encoding several levels and scoring each one, instead of starting from a result you already have.

Is a higher PSNR always better?

Higher means closer to the original, which is usually what you want, but it comes with a larger file. The right setting balances quality against your actual constraint (a size cap, a bandwidth budget), not just maximizing the score.

Why can the same dB score look different on two photos?

PSNR is a pixel-difference measurement, not a model of human perception. A busy, high-detail photo can hide more compression at a given score than a flat-color graphic, because the eye is naturally worse at spotting loss in complex detail. Use the score as a starting point, then look at the actual image if a decision is close.