Skip to content

PSNR and SSIM quality metrics

Algorithm atlasSimilarity

Measure selected differences or quality cues between images, or estimate quality without a reference.

Try it on your image ↓

VISUAL WALKTHROUGHSimilarity
REFERENCE INPUTReference image

Compare aligned images with the same numeric range.

RESULTAggregate the error

These values are computed from the displayed 16 × 12 arrays. SSIM and other perceptual metrics use different definitions.

STEP 03 / 03

Aggregate the metric while preserving any useful spatial quality map.

Computed MSE and PSNR example. Scalar error metrics summarize a spatial difference; they do not explain perceptual quality by themselves.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Compare equal-sized images. Preview shows the error map; scores appear below. The second upload is resized to match the input.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Compare reconstruction outputs when the metric’s assumptions match the task.

How it works

  1. 01Align the compared images and agree on range and channel meaning.
  2. 02Compute error statistics, local structure, gradient similarity or learned natural-scene features.
  3. 03Aggregate the metric while preserving any useful spatial quality map.

PSNR = 10 log10(peak² / MSE)

What to tune

PSNR requires the correct peak range; SSIM depends on local statistics. Report unknown pixels separately instead of treating them as correct.

Where it breaks down

A high score does not prove perceptual correctness or semantic fidelity. BRISQUE is a learned no-reference method and needs its model assets.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.