pixelmatch
A pixel-level image comparison library.
Decision gist · record as of 2026-08-14
Yes. Low install friction, no external dependencies, active maintenance, permissive ISC license, and no known vulnerabilities make it a safe choice. Well-suited for visual testing workflows; install if you need pixel-level image comparison or screenshot diffing in tests.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Images must have equal dimensions and be in RGBA format.
- Low friction: pure Python wheel with no runtime dependencies.
License · maintenance · safety
ISC (permissive) — ISC license is permissive, allowing use in commercial and proprietary projects with minimal restrictions.
last release 2026-03-07 (160 days) · last repo commit 2026-08-14 · 141 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 827,412 downloads/mo, #4,957 on PyPI
Alternatives
Verify before relying
from pixelmatch import pixelmatch
num_diff_pixels = pixelmatch(img1, img2, 800, 600, diff, threshold=0.1)- Whether the contrib.PIL module requires an external image library as an optional dependency
- Performance characteristics on very large images or batch comparisons
What it is and what it does
pixelmatch is a Python port of the Mapbox pixelmatch library, designed to detect pixel-level differences between two images. It implements anti-aliased pixel detection and perceptual color difference metrics based on published research papers, making it suitable for visual regression testing and screenshot comparison in automated tests.
The library accepts images as raw RGBA pixel data and outputs the count of differing pixels while optionally generating a visual diff image. Key parameters control sensitivity via threshold (ranging from 0 to 1), anti-aliasing handling, and diff visualization options like pixel blending and masking. A contrib module provides additional integration patterns for image instances.
Use it for
- Automated visual regression testing in UI test suites to detect unintended rendering changes
- Screenshot comparison in end-to-end tests to verify application state visually
- Batch image quality validation to flag images that deviate from expected reference images
- Diff generation for visual debugging, highlighting exactly which pixels differ between two versions
- Integration with CI/CD pipelines to fail builds when visual changes exceed acceptable thresholds
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, no external dependencies, active maintenance, permissive ISC license, and no known vulnerabilities make it a safe choice. Well-suited for visual testing workflows; install if you need pixel-level image comparison or screenshot diffing in tests.
Install
pixelmatch on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of 2026-03-07, with recent performance improvements in v0.4.0. Supports current Python versions (3.10–3.14).
Requires Python 3.10 or later. Images must have equal dimensions and be in RGBA format.
License in practice
ISC license is permissive, allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
from pixelmatch import pixelmatch
num_diff_pixels = pixelmatch(img1, img2, 800, 600, diff, threshold=0.1)
Verify before relying
- Whether the contrib.PIL module requires an external image library as an optional dependency
- Performance characteristics on very large images or batch comparisons
Package facts
| License | ISC permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 160 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 827,412 / month, #4,957 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI ApprovedProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: pixelmatch-0.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pixel-level image comparison”
- pixelmatchCompares two images pixel-by-pixel to detect differences, with…
- pytest-playwright-visualA pytest plugin that captures and compares visual snapshots of web…
- pixelhogCompares PNG screenshots pixel-by-pixel and perceptually using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pixelhog · pytest-playwright-visual · gradio-imageslider · recursive-diff · pyjson · PyScreeze · jsoncomparison · rich-pixels · lpips · ImageHash