Skip to content

Pixelmatch

The fastest and smallest pixel-level image comparison library. Visual diff tool for UI testing and design QA.

Not yet verified
Report issueDemo online
MIT★ 6500

Open the official app on mapbox.github.io

This tool is hosted by its maintainers. Click below to open mapbox.github.io in a new tab — it's their official demo.

Browse image & tools tools →

What's next with Pixelmatch?

Choose how you want to get started.

Use it free

Open the official tool or demo — no account needed.

Free

Self-host it

Run the open-source version on your own infrastructure.

Open

What is Pixelmatch?

Pixelmatch is an open-source, pixel-by-pixel image diffing library released under the permissive ISC license. Its primary job is to accept two flat image byte buffers of identical dimensions—such as a baseline reference screenshot and a newly rendered test capture—and calculate the precise count of mismatched pixels between them. The tool accepts raw 8-bit RGBA byte arrays along with image width and height integers as primary arguments. It returns an integer representing the exact number of mismatched pixels while optionally writing a color-coded visual difference map into an output buffer. Software test engineers and design system maintainers rely on this output to automatically flag unintended layout, color, or font rendering changes before code merges into production. First, Pixelmatch features specialized anti-aliasing detection algorithms that ignore subtle edge smoothing variations caused by GPU hardware acceleration and font rendering engine differences. Second, it provides a configurable color sensitivity threshold ranging from 0.0 to 1.0, where lower values increase sensitivity to minute color shifts and higher values tolerate background rendering noise. Third, it allows developers to customize output visual styling by setting explicit color parameters for changed pixels, original pixels, and anti-aliased edge structures. Compared to traditional structural comparison metrics like SSIM (Structural Similarity Index Measure) or multi-layered suites like Resemble.js, Pixelmatch prioritizes raw execution speed and zero-dependency integration. While SSIM analyzes structural patterns across spatial pixel neighborhoods, Pixelmatch performs optimized YIQ color space distance calculations on individual byte positions, executing up to five times faster in Node.js runtime environments.

How it works

When Pixelmatch executes, it iterates sequentially through the provided RGBA byte arrays using 4-byte strides representing red, green, blue, and alpha channel values. For each pixel location, it calculates the perceptual color difference between corresponding pixels using a modified YIQ color space formula, where luminance (Y) and chromaticity (I, Q) are weighted according to human visual perception thresholds. Consider two 800x600 pixel PNG images converted into flat Uint8Array buffers containing 1,920,000 bytes each. If Pixelmatch evaluates byte index 4,000 and finds baseline values of RGBA(255, 0, 0, 255) and target values of RGBA(200, 0, 0, 255), it computes the perceptual distance against the configured threshold (such as 0.1). If the distance exceeds 0.1, the differential counter increments by 1, and the target index in the diff output buffer is written with solid magenta RGBA(255, 0, 255, 255).

How to use it

  1. 1Use the Pixelmatch tool.
  2. 2Use the Pixelmatch tool.
  3. 3Use the Pixelmatch tool.
  4. 4Use the Pixelmatch tool.

What it can do

  • Difference Detection
  • Image Processing

Use cases

Assumptions and limitations

Assumptions

  • source: https://github.com/mapbox/pixelmatch
  • license: ISC — free to use
  • privacy: Opens an external demo

Limitations

  • External demo — opens a third-party website that you do not control.
  • Relies on an external source (github.com); availability depends on that service.
  • Focused on the image tools category: The fastest and smallest pixel-level image comparison library. Visual diff tool for UI testing and design QA..

Understanding the result

The fastest and smallest pixel-level image comparison library. Visual diff tool for UI testing and design QA.

Tool details

  • Clearly flagged when a network request is needed.
  • No account, no sign-up, and no tracking of your content.
  • Powered by pixelmatch (MIT).
Built with
pixelmatch (mapbox/pixelmatch)
License
MIT
Runs locally
No — requires a network request
Verification
Not yet verified
Input
Image File
Output
Image
Open-source source & license

Built with mapbox/pixelmatch. OpenToolVault provides the discovery and browser interface while crediting the original project maintainers.

Built with
pixelmatch
License
MIT
View source on GitHub

Open-source project

OpenToolVault is an independent directory. We are not affiliated with or endorsed by this project.

References

Frequently asked

What is Pixelmatch?

The fastest and smallest pixel-level image comparison library. Visual diff tool for UI testing and design QA.

Where can I find the source code?

Source: https://github.com/mapbox/pixelmatch

What license is this tool?

License: ISC

Spotted something wrong with Pixelmatch, or want to maintain it? See how to help.