Reading similarity scores: SSIM, PSNR, hash distance and cosine similarity
Each score answers a narrower question than “how similar are these?”. Knowing which question it answers is how you avoid reading too much into it.
SSIM — does the structure match?
Structural similarity compares small windows of the two pictures for brightness, contrast and the pattern of light and dark, and averages the result from 0 to 1. It forgives a uniform brightness change better than a pixel count does and punishes blur and blockiness, which is why it tracks what people notice reasonably well. Above about 0.97 two pictures usually look the same at normal size.
PSNR — how large is the error?
Peak signal-to-noise ratio turns the average squared pixel error into decibels. Higher is closer; identical pictures give infinity. It is simple and widely quoted for compression, but it treats an error in flat sky and an error on a face the same, and a small shift of the whole picture wrecks it even though nothing visible changed — which is why ComparePicture aligns the pictures before measuring.
Hash distance — is it the same picture?
A perceptual hash reduces a picture to 64 bits that survive resizing and recompression. The distance is how many bits differ: 0 to about 5 suggests the same picture in another size or format, around 32 is what two unrelated pictures give by chance. ComparePicture shows it as the share of bits that agree. It answers “is this a copy?”, not “what changed?”.
ΔE — how far apart are the colours?
ΔE2000 measures colour difference in a way designed to follow human vision: about 1 is the smallest difference most people can see side by side, 2–3 is noticeable, above 10 is a different colour. The workspace gives the mean and the 95th percentile over the aligned pixels, and pairs the dominant colours of the two pictures.
Cosine similarity — do they show similar things?
The optional on-device visual model turns each picture into a list of 1,280 numbers that describe its content, and cosine similarity compares the two lists. It can say two photos of a beach are alike even when no pixel matches — and it can also call two photos of different people alike if the setting is the same. It is a hint about content, never proof of identity; see why there is no face match here.
Worked pairs
Ranges for common pairs. Content moves every number: a smooth drawn landscape sits at the top of each range (our own check: JPEG 80 gave SSIM 0.996 and 46 dB), a detailed photo of foliage or fabric near the bottom. Note how the colour grade barely moves SSIM but drops PSNR — the clearest example of the two answering different questions.
| Pair | SSIM | PSNR | pHash distance |
|---|---|---|---|
| Same photo, re-saved as JPEG quality 80 | 0.95–0.996 | 35–46 dB | 0–2 bits |
| Same photo, resized to half and back | 0.90–0.998 | 30–52 dB | 0–4 bits |
| Same photo, warmer colour grade | 0.97–0.998 | 22–30 dB | 0–6 bits |
| Two shots of a scene a second apart | 0.5–0.8 | 18–24 dB | 6–20 bits |
| Two unrelated photos | below 0.3 | below 15 dB | about 32 bits |
To see the scores for your own pair, use the similarity checker, or compare a compressed copy with its original.