Image Diff

Find exactly which pixels differ between two images: a difference map, the share of changed pixels, the number of changed regions, the largest change and PSNR, with a threshold to ignore re-save noise.

Tool Media & Files Updated Oct 16, 2026
How to Use
  1. Drop the original on A and the changed copy on B (or click each box to browse). TIFF, PSD, HEIC, TGA and RAW files open too. A built-in sample pair is loaded so you can try it straight away.
  2. Set the Threshold: a pixel counts as different only when its largest channel change is above it. 0 finds every change; 8 ignores the small wobble of a re-saved JPEG.
  3. Choose a View: red overlay, heat map, black-and-white mask, or the amplified difference |A − B|.
  4. Read the share of differing pixels, the number of changed regions, the largest change and PSNR, and click any pixel to see its values worked through in Show Work.
  5. Save the difference picture in any format from the Save panel.
Images & Threshold
A — original
B — changed copy
levels of 255; differs if change > this
× (heat, |A − B|)
Presets
Difference
Differing Pixels
—
Changed Regions
—
Largest Change
—
PSNR
—

Worked Example

The built-in sample pair at threshold 8. Both pictures are 640 × 420 = 268,800 pixels. B has three edits, a lit window, a blue door and a bird, plus up to ±3 levels of noise on every pixel. 3,240 pixels differ, 1.205%, in 6 regions: the four window panes (the bars between them did not change), the door and the bird. The door is the largest region, 34 × 62 = 2,108 px. One door pixel goes from (56, 39, 27) to (32, 79, 122): the changes are 24, 40 and 95, and the largest, 95, is above 8, so it counts.

The same pair measured as a whole. PSNR does not depend on the threshold. The squared channel differences add up to 48,834,785 over 3 × 268,800 = 806,400 values, so MSE = 60.559 and PSNR = 10 × log₁₀(65,025 ÷ 60.559) = 30.31 dB. The dashed box around all changes runs from x 128 to 329 and y 81 to 339.

The common mistake: comparing a re-saved copy at threshold 0. The ±3 noise is invisible, yet at threshold 0 it makes 235,450 pixels, 87.593%, “differ”, all joined into a single region that hides the three real edits. Raising the threshold to 8 removes the noise and leaves only the changes that matter.

Show Work

Load two images to see one pixel and the whole picture worked through.

Formulas

Change at a pixel
Δ = max(|RA − RB|, |GA − GB|, |BA − BB|, |αA − αB|)
the pixel differs when Δ > threshold
Differing share
p = count(Δ > t) ÷ N
N = width × height
Mean squared error
MSE = Σ (ΔR² + ΔG² + ΔB²) ÷ 3N
mean absolute error uses |Δ| instead of Δ²
PSNR
PSNR = 10 × log₁₀(255² ÷ MSE)
in dB; ∞ when MSE = 0
Changed regions
8-connected components of the mask
two passes: label each pixel from its left and upper neighbours, then merge touching labels

Measuring Image Difference

Mean squared error and peak signal-to-noise ratio are the oldest and simplest measures of how far one image is from another, and they are still widely used to report the losses of image and video codecs. For 8-bit pictures the peak value is 255, so PSNR = 10 × log₁₀(255² ÷ MSE). Lossy compression typically lands somewhere between about 30 and 50 dB, and every halving of the MSE adds about 3 dB.

Because MSE treats every pixel the same, it can disagree with what people see: a picture shifted one pixel sideways looks identical but scores badly, while a blur that destroys detail may score well. Perceptual measures such as SSIM, the structural similarity index introduced by Wang, Bovik, Sheikh and Simoncelli in 2004, were developed to close that gap. For finding where something changed, as in screenshot testing, a per-pixel threshold and a map of the changed regions remain the most direct answer.

About This Tool

This tool compares two images pixel by pixel, counts the pixels that change by more than a threshold, groups them into regions, reports the largest change, mean absolute error, MSE and PSNR, and draws the result as an overlay, heat map, mask or amplified difference. Any pixel can be clicked to see its values from both images. Settings can be put in the page address, for example ?th=0&view=heat&gain=8. To look at two versions with a before/after slider instead, use Image Compare.

Images are decoded and saved in your browser by the engine behind the Universal Image Converter, so TIFF, PSD, HEIC, TGA and RAW files work too. Nothing is uploaded.

Related tools: Image Compare, Image Compressor, and Image Verifier & Forensics.

Frequently Asked Questions

How is this different from Image Compare?

Image Compare is for looking: a before/after slider, side by side or a cross-fade, where you judge the change with your eyes. Image Diff is for measuring: it checks every pixel, counts how many changed and where, and gives numbers such as PSNR. Use Compare for a retouch or a design review, and Diff for screenshot tests and finding small or hidden edits.

What threshold should I use?

Use 0 when the two files should be bit-for-bit identical, for example two PNG exports of the same screen. Use around 8 when one copy has been re-saved as JPEG or WebP, which nudges many pixels by a few levels without any visible change. Use 32 or more to show only changes a person would easily notice.

What does PSNR mean?

Peak signal-to-noise ratio, 10 × log₁₀(255² ÷ MSE) in decibels, where MSE is the mean of the squared channel differences. Higher means closer: identical images are infinite, an MSE of 4.0 gives 42.11 dB, and an MSE of 100 gives 28.13 dB. It is a measure of numerical difference and does not always match how different the pictures look.

What if the two images are different sizes?

By default B is scaled to A’s size before comparing, which lets you check a resized copy, but scaling itself changes many pixels slightly, so raise the threshold. Choose “Compare the overlapping area” to compare only the top-left part both images share, pixel for pixel, with no scaling.

What counts as one changed region?

A group of differing pixels that touch, side by side or corner to corner. Three separate edits give three regions; a whole-picture brightness change gives one large region, and JPEG noise below the threshold gives none. The dashed box marks the smallest rectangle that holds every differing pixel.

How do I use the Image Diff?

Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

Visual regression testing

Compare two screenshots of a web page: at threshold 0, a single changed button shows up as one small region among about 2.07 million pixels at 1920 × 1080.

Checking compression damage

Diff an original against its JPEG copy and read the PSNR: higher is closer, and halving the error adds about 3 dB.

Spotting edits in a picture

A heat map shows where a photo was retouched or a detail was removed, even when the change is too faint to notice.

Confirming two exports match

Two renders of the same design that differ in 0 pixels at threshold 0 are identical, whatever their file sizes.

Last updated: