Compare Two JPEGs
Compare two JPEG images pixel-by-pixel with visual diff map, overlay slider, SSIM score, Delta E analysis, and detailed statistics.
About
Pixel-level image comparison is a non-trivial problem. Human eyes perceive color differences non-linearly, so a simple RGB subtraction produces misleading results. This tool converts each pixel pair from sRGB to the CIELAB color space and computes ฮE (CIE76), the Euclidean distance in perceptual color space. A ฮE below 2.0 is generally imperceptible. Above 10.0, colors are perceived as entirely different. The tool also calculates SSIM (Structural Similarity Index), which evaluates luminance, contrast, and structure independently. SSIM ranges from 0 (no similarity) to 1 (identical). Relying on visual inspection alone risks missing sub-pixel shifts, compression artifacts, or color profile mismatches that silently degrade asset quality across production pipelines.
Both images are resampled to a common resolution before comparison. This introduces interpolation error for mismatched dimensions. For accurate results, compare images of identical resolution. The difference map uses a false-color heat scale: blue indicates no change, red indicates maximum deviation. PSNR (Peak Signal-to-Noise Ratio) is reported in dB. Values above 40 dB typically indicate visually lossless quality. Note: this tool operates entirely in your browser. No images are uploaded to any server.
Formulas
The perceptual color difference uses the CIELAB color space. First, sRGB values are linearized and transformed to CIE XYZ, then to CIELAB coordinates (L*, a*, b*).
Peak Signal-to-Noise Ratio measures overall fidelity against the maximum possible pixel value.
Where MSE = 1N Nโi=1 (xi โ yi)2 is the Mean Squared Error across all pixel channels.
The Structural Similarity Index (SSIM) evaluates three components per window.
Where ฮผ denotes mean, ฯ2 variance, ฯxy covariance. Constants C1 = (0.01 โ 255)2 and C2 = (0.03 โ 255)2 stabilize division near zero.
Reference Data
| Metric | Range | Interpretation | Use Case |
|---|---|---|---|
| ฮE (CIE76) | 0 - 100+ | < 1: imperceptible; 1 - 2: close observation; > 10: different color | Print proofing, brand color compliance |
| SSIM | 0 - 1 | 1.0 = identical; > 0.95: excellent; < 0.5: poor | Compression quality assessment |
| PSNR | 0 - โ dB | > 40: excellent; 30 - 40: good; < 20: poor | Codec benchmarking |
| Mean Absolute Error | 0 - 255 | 0 = identical pixel values | Artifact detection |
| Max Channel Diff | 0 - 255 | Peak deviation in any single RGB channel | Clipping detection |
| Changed Pixels % | 0 - 100% | Fraction of pixels exceeding threshold | Regression testing |
| Histogram Correlation | โ1 - 1 | 1 = identical distribution; 0 = uncorrelated | Exposure/color shift detection |
| JPEG Quality (est.) | 1 - 100 | Estimated from quantization tables if available | Compression level comparison |
| File Size Ratio | 0+ | Image B size รท Image A size | Compression efficiency |
| Resolution Match | Yes / No | Whether both images share identical dimensions | Pipeline validation |
| Luminance Mean Diff | 0 - 255 | Average brightness difference (grayscale) | Exposure comparison |
| Color Gamut Coverage | 0 - 100% | % of unique colors in A present in B | Posterization detection |