Skip to main content
Develop Tools
← Return to usage guide

How to Compare Two Images Pixel by Pixel

Comparing images before and after changes only by eye can miss a 1 px offset or small color change. Fix Before on the left and After on the right, then narrow the review from the whole image to pixel differences.

Flow for comparing Before and After images at the same coordinates and highlighting differing pixels
Flow for comparing Before and After images at the same coordinates and highlighting differing pixels

Check changed areas of an image in the browser

After loading Before and After, you can switch among side-by-side, overlay, and pixel-diff views in the browser.

Open the Image Difference Checker

Conclusion: Narrow down gradually from overall comparison to pixel differences

First use side-by-side view to inspect omissions and additions, then use overlay to check misalignment, and finally read pixel differences and statistics. Do not decide pass or fail from the difference rate alone; confirm that highlighted locations are the intended changes.

Different File Hashes and different display Pixels are not the same thing. Images that differ only in Metadata may match in Pixel comparisons.

Check the images to compare and the assumptions.

Align left/right roles, image dimensions, format, and capture conditions. If the baseline is reversed, the number of differing pixels is the same but the explanation of the changes is reversed.

ItemWhat to checkImpact on differences
left and rightFix the left as Before and the right as AfterMake the direction of changes easier to explain
DimensionsCheck width and heightSeparate differences in margins and positional offset
FormatCheck PNG, JPEG, WebP, and morePredict effects of compression and Alpha
Capture conditionsMatch the Viewport, scale, and FontReduce noise caused by environment differences

Check with the image diff comparison tool

  • 1. Select the reference image on the left and the modified image on the right.
  • 2. Check the displayed width, height, and file name.
  • 3. Review large changes side by side.
  • 4. Adjust overlay opacity to check outline misalignment.
  • 5. Switch to pixel differences and check the threshold and number of differing pixels.
  • 6. If needed, save the difference image as PNG.

Check image size, position, and resolution

The current tool uses the larger width and height of two images as the comparison canvas and centers each image. If dimensions match, it can compare the same coordinates directly.

Images with different sizes are not automatically scaled. Do not mistake differences around the image for content changes.

Read Pixel Diff and statistics.

For each pixel, find the maximum difference among R, G, B, and alpha, and count coordinates exceeding the threshold as changed pixels. The difference ratio is the number of changed pixels divided by the total number of pixels compared.

DisplaymeaningNotes for making a determination
Differential number of pixelsNumber of coordinates exceeding the ThresholdNumber of coordinates, not changed area
Difference ratioDiffering pixel count ÷ total pixel countSmall UI component changes are important even when the rate is low
Maximum differenceDisplay the maximum channel difference from 0 to 255Do not display which channel it is

Adjust the Threshold

First, inspect the distribution with the initial value of 16. Lower it if you want to include subtle edge differences, and raise it gradually if you want to suppress compression noise. Check highlighted locations and statistics together whenever you change the value.

There is no universally correct Threshold value. Define the comparison purpose and acceptable Rendering differences, then evaluate continuously under the same conditions.

Check alpha, antialiasing, and image format.

Even if they look the same, differences can result from JPEG compression, font rendering, and RGB values of transparent pixels. The current tool performs strict RGBA comparison including alpha, so isolate differences from visual appearance by cause.

FactorsDifferences that occurHow to check
JPEGSubtle color differences across a wide areaAlso compare the PNG version.
Anti-aliasingDot-like differences at the boundaries of text or diagonal linesRecapture using the same OS, browser, and font.
AlphaDifferences in transparent areas and semi-transparent shadowsChange the background color and check the appearance as well.

Reduce unnecessary differences and isolate the cause.

  • Swap left and right to rule out mixing up Before / After.
  • Place the same image on the left and right and check whether the difference becomes 0.
  • If image dimensions differ, align the original capture area.
  • For JPEG, also compare output re-exported as PNG.
  • Map highlighted locations to elements on the original screen, not only the difference rate.

Use image comparison methods appropriately

AlgorithmDifferences that are easy to checkThis Tool
Side-by-SideAdditions, deletions, and major layout changesSupported
OverlayVisual checks with changed position, edges, and opacitySupported
Pixel-level DiffRGBA differences at the same coordinates and the number of differing pixelsSupported
Visual / Perceptual DiffA judgment that allows small differences people perceive as the sameDedicated detection is not supported

Pixel-level Diff does not understand visual meaning; it compares values at the same coordinates. Evaluate numeric differences separately from defects visible to users.

Supported scope of the current image diff comparison tool

ItemCurrent supportUnsupported features and verification notes
InputLeft and right file selection, Drag & Drop, and dropping one or two items onto the pageNo clipboard pasting or URL loading
FormatPNG, JPEG, WebP, GIF, BMP, SVG, and similar formats that the browser can decode as image/*HEIC and similar formats depend on browser support, and all-frame comparison for animated images is unavailable
DisplaySide-by-Side, Overlay, Pixel difference, and ZoomThere is no Swipe Slider or synchronized Pan
DimensionsCenter each image on the larger canvasNo automatic resize, crop, manual offset, or automatic alignment
Difference determinationTreat a Pixel as changed when the maximum RGBA Channel difference exceeds the Threshold.Threshold ranges from 0 to 255 and is different from Pixelmatch's 0 to 1 setting
Alpha and outlinesInclude the alpha channel in comparison.There is no alpha ignore, background compositing, or antialiasing exclusion.
StatisticsCompared dimensions, differing pixel count, difference rate, and maximum channel differenceNo Similarity rate, Bounding Box, or difference region count
outputDownload the difference image as PNGSaving comparison settings or history and exporting reports are not supported.
Processing locationDecode, Canvas drawing, and comparison run on the browser's main threadWeb Worker is not used. The Tool does not Upload image Binary or File names to the Server

When image sizes differ, center the smaller image without enlarging it and compare surrounding transparent areas as well. This is not the result of automatic alignment or cropping.

Compare primary sources with the current implementation

Pixelmatch and Playwright Thresholds and Options are specific to their respective Libraries. Do not treat them as the same values as DevelopTools' 0–255 Threshold; check the official documentation for the implementation you use.

An example of comparing before and after changes in the settings screen

Prepare PNGs captured with the same viewport as Before and After.

Verify that layout shifts were not introduced when the intention was to change only the button color.

  1. Load Before on the left.
  2. Load After on the right.
  3. Verify that outlines overlap in the Overlay.
  4. Confirm that only the area around the button is emphasized by the Pixel difference.
  5. Record the differing pixel count and threshold.

If elements other than the intended button are also highlighted, check font, animation, and viewport conditions.

Frequently asked questions

Is the image content sent to a server?
Comparison processing runs in the browser, and the tool does not upload selected images to a server.
If the difference rate is 0%, are the files completely identical?
Displayed Pixels match within the configured Threshold, but verify File Binary equality, including Metadata and compression structure, separately with a Hash.