Pixel similarity vs perceptual similarity
Why two pictures can differ in every pixel and still look identical — and which measure to trust for which question.
Two pictures, two different questions
A pixel comparison asks: does position (x, y) hold the same colour in both pictures? A perceptual comparison asks: would a person looking at them see the same thing? The answers diverge all the time. Shift a photograph one pixel to the right and nearly every pixel changes, yet nobody could tell the two apart. Change the colour of a single small button and fewer than one percent of pixels change, yet it is the first thing a designer notices.
What each measure on ComparePicture is sensitive to
| Measure | Moves a lot when… | Barely moves when… |
|---|---|---|
| Changed pixels (mismatch %) | anything shifts, even by one pixel | a change is smaller than the threshold |
| SSIM | edges, texture or local contrast change; blur | the whole picture gets uniformly brighter |
| pHash | the composition changes | the picture is resized, recompressed or lightly edited |
| dHash | gradients reverse or objects move | colours shift but light/dark structure stays |
| Histogram similarity | the colour mix changes | objects move around but keep their colours |
| Edge similarity | outlines are added, removed or moved | only colours or tones change |
| Visual content similarity | the subject or scene changes | the same scene is cropped, resized or regraded |
Why alignment comes first
Both kinds of measure assume the two pictures are laid over each other correctly. When they are not — a screenshot captured after a scroll, a photo exported at a different size — a pixel diff reports everything as changed and SSIM collapses, while pHash and visual similarity, which look at each picture whole, stay high. That disagreement is itself informative: it is how the workspace knows to try alignment. Once B is placed where it belongs, the pixel and structural measures become meaningful again.
Which to trust
For QA, where any unintended change is a bug, trust the pixel diff with a small tolerance. For “is this the same photo?”, trust the perceptual hashes and, if you load it, visual similarity. For “did the edit damage detail?”, trust SSIM and the sharpness measures. The similarity view shows all of them at once so you do not have to choose in advance.