induwara.lk
induwara.lkDeveloper · Image & Video

SSIM Calculator — Structural Similarity Index

Measure how perceptually close two images are. Upload a reference and a distorted version to get the Mean SSIM over an 11×11 Gaussian window, or paste two pixel lists to hand-check the maths. You get the score, a quality band, and the luminance, contrast and structure breakdown. Verified against scikit-image.

By Induwara AshinsanaUpdated Jun 26, 2026
Calculate SSIM
Wang et al. · scikit-image verified

C1 = (K1·L)² = 6.5025 · C2 = (K2·L)² = 58.5225

Comma-, space-, or newline-separated. Each value 0–255.

Must have the same number of values as the reference list.

SSIM
0.9845
Samples compared
4
Luminance · Contrast · Structure
1.0000 · 0.9882 · 0.9963
Quality band
Excellent

Very close to the reference; high quality.

TermInputsValue
Luminance l(x,y)μx=25 · μy=251.0000
Contrast c(x,y)σx²=166.6667 · σy²=118.66670.9882
Structure s(x,y)σxy=1400.9963
SSIM = l · c · s0.9845

Cross-check

Component product l·c·s = 0.9845 matches the combined single-fraction form = 0.9845.

All maths runs in your browser — no image ever leaves your device. Formula and constants from ; image mode is cross-checked against scikit-image.

How it works

SSIM (Structural Similarity Index) measures how close a distorted image — compressed, denoised, super-resolved or generated — is to a reference, but unlike pixel-error metrics it models how the human eye reads a scene: as structure rather than isolated pixels. It is defined by Wang, Bovik, Sheikh & Simoncelli (2004) and implemented as the de-facto standard by scikit-image, which this tool cross-checks against.

  1. Local statistics. For two aligned signals x and y over a window, compute the means μx, μy, the sample variances σx², σy² (divided by N−1 to match scikit-image), and the covariance σxy.
  2. Stabilising constants. C1 = (K1·L)² and C2 = (K2·L)² with K1 = 0.01, K2 = 0.03 and L the dynamic range (255 for 8-bit) — giving C1 = 6.5025 and C2 = 58.5225 at L = 255.
  3. Three comparison terms. Luminance l = (2μxμy + C1)/(μx² + μy² + C1), contrast c = (2σxσy + C2)/(σx² + σy² + C2), and structure s = (σxy + C2/2)/(σxσy + C2/2).
  4. Combine. With the usual weights (α=β=γ=1), SSIM = l · c · s, which is algebraically the single fraction [(2μxμy + C1)(2σxy + C2)] / [(μx² + μy² + C1)(σx² + σy² + C2)]. The tool shows both and confirms they agree as a cross-check.
  5. Mean SSIM for whole images. Both images are converted to luminance, then an 11×11 Gaussian window (σ=1.5) slides across them computing a local SSIM at each position. Averaging those windows gives the Mean SSIM (MSSIM). Identical dimensions are required and validated up front; nothing is uploaded — all of this runs in your browser.

The coloured quality band (essentially identical ≥ 0.99, excellent 0.95–0.99, good 0.90–0.95, fair 0.80–0.90, poor < 0.80) is a widely used heuristic for a quick read, not part of any standard — the page says so next to the result. SSIM is single-scale here; multi-scale MS-SSIM and video SSIM are out of scope for this version.

Worked examples

Short pixel lists (hand-checkable)

Reference [10, 20, 30, 40] vs Distorted [12, 22, 28, 38], L = 255

  1. Means: μx = 25, μy = 25
  2. Sample variances (÷3): σx² = 500/3 ≈ 166.667, σy² = 356/3 ≈ 118.667
  3. Covariance: σxy = 420/3 = 140
  4. l = (2·625 + 6.5025)/(1250 + 6.5025) = 1.0000
  5. c = (2·12.910·10.893 + 58.5225)/(285.333 + 58.5225) = 0.98817
  6. s = (140 + 29.261)/(140.626 + 29.261) = 0.99627
  7. SSIM = l·c·s = 0.9845 → band: excellent

Pure brightness shift (edge case)

Distorted = Reference + 50: [10,20,30,40] vs [60,70,80,90], L = 255

  1. Means: μx = 25, μy = 75 (variances and covariance unchanged)
  2. l = (2·25·75 + 6.5025)/(625 + 5625 + 6.5025) = 0.60042
  3. c = 1.0000 and s = 1.0000 (structure is identical)
  4. SSIM = 0.6004 → band: poor
  5. PSNR-from-MSE would only see the squared error; SSIM flags the shift.

Identical images

Reference = Distorted → no distortion

  1. μx = μy, σx² = σy² = σxy at every window
  2. Each of l, c and s evaluates to exactly 1
  3. SSIM = 1·1·1 = 1.0000
  4. Image mode returns Mean SSIM = 1.0000 → band: essentially identical

Frequently asked questions

Sources & references

The SSIM formula, the C1 = (K1·L)² / C2 = (K2·L)² constants, and the 112 Gaussian-window Mean SSIM on this page were last cross-checked against the Wang et al. (2004) paper and scikit-image on 2026-06-26. The quality bands are explicitly labelled as heuristics, not a standard.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.