Compare WebP Images
Compare two WebP images side-by-side with pixel diff, PSNR, SSIM analysis, slider overlay, and histogram comparison. Free browser tool.
About
Lossy WebP compression introduces quantization artifacts that are invisible at a glance but measurable at the pixel level. A 1dB drop in PSNR can correspond to visible banding in smooth gradients. This tool computes the actual per-pixel difference map between two images, calculates PSNR and a simplified SSIM index, and renders per-channel histograms so you can quantify degradation rather than guess at it. It works entirely in your browser. No uploads, no server processing.
Typical use: compare a lossless source against its WebP-encoded output at various quality settings (q = 50, 75, 90) to find the lowest file size that keeps PSNR above 40dB and SSIM above 0.98. The tool also accepts PNG and JPEG for cross-format comparison. Note: SSIM here uses an 8×8 block approximation rather than a full Gaussian-weighted window, so values may differ slightly from reference implementations like the original Wang et al. (2004) algorithm.
Formulas
Peak Signal-to-Noise Ratio measures the ratio between the maximum possible pixel value and the distortion (noise) introduced by compression:
where MAX = 255 for 8-bit images. The Mean Squared Error is computed as:
where N is the total number of pixel-channel samples and Ai, Bi are individual channel values in images A and B.
The simplified Structural Similarity Index (per block) is:
where μ is the block mean, σ2 the variance, σAB the covariance, C1 = (0.01 ⋅ 255)2 and C2 = (0.03 ⋅ 255)2 are stabilization constants. The final SSIM is the mean across all blocks.
Reference Data
| Metric | Range | Excellent | Good | Poor | Notes |
|---|---|---|---|---|---|
| PSNR | 0 - ∞ dB | > 40 | 30 - 40 | < 30 | Identical images → ∞ |
| SSIM | 0 - 1 | > 0.98 | 0.90 - 0.98 | < 0.90 | Perceptual quality measure |
| MSE | 0 - 65025 | < 10 | 10 - 100 | > 100 | Mean Squared Error per pixel |
| WebP Lossy q=100 | - | Near-lossless, PSNR typically > 45dB | Largest file size | ||
| WebP Lossy q=80 | - | PSNR ≈ 36 - 42dB | Common web default | ||
| WebP Lossy q=50 | - | PSNR ≈ 30 - 36dB | Visible artifacts in gradients | ||
| WebP Lossy q=20 | - | PSNR ≈ 25 - 30dB | Heavy blocking, color shift | ||
| WebP Lossless | - | PSNR = ∞, SSIM = 1.0 | Bit-identical decode | ||
| JPEG q=80 | - | PSNR ≈ 34 - 38dB | WebP typically 25 - 34% smaller | ||
| PNG (lossless) | - | Reference baseline | No quality loss, large file | ||
| Pixel Diff Amplification | 1× - 20× | Higher reveals subtle changes | Default 10× in this tool | ||
| Color Channels | R, G, B, A | Each compared independently | Alpha channel included | ||
| Histogram Bins | 256 | Full 8-bit range | Per channel | ||
| Max Image Size (this tool) | - | 4096×4096px | Larger images downscaled | ||