# Image diff tool

> Compare two screenshots or images in your browser: a diff overlay, the share of changed pixels and the same changed/unchanged verdict Snapvisor's engine gives.

Source: https://snapvisor.io/tools/image-diff

Free tool

Drop in two screenshots to see every changed pixel, the share of the image that changed and whether Snapvisor would flag the pair as a visual change. The comparison runs in your browser: your images are never uploaded.

Baseline image Choose or drop an image New image Choose or drop an image

Threshold 0.50

Add two images, or try the example pair, to see the diff.

## How to compare two images

1. **Add the baseline.** Choose or drop the image you expect, for example the screenshot from your main branch.
2. **Add the new image.** Choose or drop the image to check, for example the same screen from a pull request.
3. **Set the threshold.** Keep the default 0.5 or lower it to make the comparison stricter, the same setting your Snapvisor screenshots take.
4. **Read the result.** The verdict says whether Snapvisor would flag a change; the overlay marks every pixel that counted.

## How the verdict is reached

Two pixels differ when their colour distance, measured in the YIQ colour space after blending each pixel over white, passes the pixel threshold. A differing pixel on an edge between a darker and a brighter area that is flat in both images is treated as antialiasing and left out. The share of pixels left is the score.

Snapvisor runs that comparison twice on every screenshot. The base pass uses a loose pixel threshold and ignores a change smaller than 20 pixels or 0.02% of the image, whichever is smaller. The colour-sensitive pass uses a tight threshold and ignores anything under 3% of the image. The score is read to two decimals of a percent, so a change under 0.005% of the image reads as zero. This page runs the same steps, with the same numbers, as [the review workflow](https://snapvisor.io/docs/review-workflow) that decides which screenshots your team sees.

## Use it from code, no key

`POST https://api.snapvisor.io/v2/tools/image-diff` runs the comparison on Snapvisor's servers with the diff engine every build uses (odiff, the same two passes) and answers the verdict as JSON, or as Markdown with `Accept: text/markdown`. Send the two images as multipart fields `base` and `head`, and optionally a `threshold` from 0 to 1. No account or key: 20 comparisons a day per address, images up to 5 MB and 16 million pixels each, nothing stored. Errors are RFC 9457 problem details, and the operation is in the [OpenAPI description](https://api.snapvisor.io/v2/openapi.yaml).

shell

```
curl -s https://api.snapvisor.io/v2/tools/image-diff \
  -F base=@baseline.png \
  -F head=@new.png \
  -F threshold=0.5
```

## Compare every screenshot on every pull request

Comparing one pair by hand finds one change. Snapvisor takes the screenshots in your Playwright, Cypress, Puppeteer or Storybook tests, compares each one with the [baseline from your main branch](https://snapvisor.io/docs/baseline-build), and posts the changes to the pull request for review. The [SDKs](https://snapvisor.io/docs/sdks) take the same threshold option as this page. [Start free](https://app.snapvisor.io/signup) or read the [visual regression testing guide](https://snapvisor.io/visual-regression-testing).

## Image diff FAQ

### How does the image diff decide that two screenshots changed?

It compares the images twice, as Snapvisor's engine does. A loose pass tolerates antialiasing and rendering noise and ignores a change smaller than 20 pixels or 0.02% of the image, whichever is smaller. A strict pass catches colour shifts and ignores anything under 3% of the image. If either pass still finds a difference, the pair counts as changed.

### Are my images uploaded anywhere?

No. The images are read and compared by JavaScript in this page, on your device. Nothing is sent to Snapvisor or anyone else, so you can compare screenshots of private apps.

### What does the threshold do?

It scales how different two pixels must be before they count, and how many changed pixels each pass ignores. The default is 0.5; 0 is the strictest setting. Snapvisor screenshots take the same threshold option, so the verdict here is the one your build would show at that setting.

### Can I compare images of different sizes?

Yes. Both images are placed at the top-left of a canvas as large as the larger one, and the missing area counts as transparent, which is how Snapvisor lines up screenshots of different heights. An image smaller in both directions is first scaled up to fit.

### How is this different from running visual tests in Snapvisor?

This page compares one pair of images by hand. Snapvisor takes screenshots in your Playwright, Cypress, Puppeteer or Storybook tests, compares every one against the baseline from your main branch on each pull request, and lets your team approve or reject each change.

## Related pages

Guides [How visual regression testing works](https://snapvisor.io/visual-regression-testing) [Self-hosted visual regression testing](https://snapvisor.io/self-hosted-visual-regression-testing) [Visual regression testing in GitHub pull requests](https://snapvisor.io/visual-regression-testing-github) [Snapvisor MCP server](https://snapvisor.io/mcp)

Test runner and CI setup [Playwright visual testing setup](https://snapvisor.io/playwright) [Storybook visual testing setup](https://snapvisor.io/storybook) [Cypress visual testing setup](https://snapvisor.io/cypress) [Puppeteer visual testing setup](https://snapvisor.io/puppeteer) [Visual regression testing in GitLab CI](https://snapvisor.io/gitlab-ci)

Compare Snapvisor [Snapvisor vs Percy](https://snapvisor.io/compare/percy) [Snapvisor vs Chromatic](https://snapvisor.io/compare/chromatic) [Snapvisor vs Applitools](https://snapvisor.io/compare/applitools) [Snapvisor vs Argos](https://snapvisor.io/compare/argos) [Snapvisor vs Lost Pixel](https://snapvisor.io/compare/lost-pixel) [Snapvisor vs Playwright snapshots](https://snapvisor.io/compare/playwright)

Free tools [Screenshot calculator](https://snapvisor.io/tools/screenshot-calculator)
