NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #2976 most downloaded on npm
The smallest and fastest pixel-level image comparison library.
Latest stable
8.0.0
Last release 1 months ago
06 Oct 2026
Release timing varies
gaps range from 6 weeks to 2.8 years
Nearly every release is documented
notes for 21 of 23 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
23 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
A major update: a new, much more accurate color difference metric (replacing the one used since 2015), and two new options for handling noise and irre
A major update: a new, much more accurate color difference metric (replacing the one used since 2015), and two new options for handling noise and irrelevant regions in tests.
Colors are now compared using the OKLab color space and the HyAB distance instead of YIQ. It's much closer to how people perceive color differences, so you get fewer false positives and fewer missed changes (#127). The math is more involved, but it's heavily optimized, so pixelmatch runs nearly as fast as before.
windowSize optionReturns the largest number of differing pixels in any N×N square instead of the total count. Scattered noise like GPU dithering or font anti-aliasing stays low, while real changes, which are usually compact, stand out:
if (pixelmatch(img1, img2, null, width, height, {windowSize: 16}) > 28) throw new Error('changed');
ignoreMask optionA per-pixel mask of areas to skip, like timestamps or animations. (#171 by @Venefilyn, closes #163)
The API is unchanged, and threshold keeps its scale (0 to 1, where 1 is black vs. white) and 0.1 default. But diff counts will differ because of the new metric. If your tests rely on exact counts or a tuned threshold, re-check them.
v8.0.0 Latest
Latest
Compare
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Add a checkerboard option that controls whether to blend semi-transparent pixels against a checkerboard pattern (true, default) or plain white (false,
Add a checkerboard option that controls whether to blend semi-transparent pixels against a checkerboard pattern (true, default) or plain white (false, pre-v7 behavior) when comparing images.
Improve performance by ~8%. #165
includeAA is true. #160 (by @mongoose700)Add first-class TypeScript types to the project. They'll be maintained in the repo from now on. #139
Potentially breaking: improve handling of semitransparent pixels. Previously, they were blended with white, so a transparent pixel vs white pixel woul
undefined is passed explicitly. (h/t @denis-sokolov #146)⚠️ Breaking: publish pixelmatch as a ES module. Use the older v5.3.0 if you need to support CommonJS environments.
⚠️ Breaking: publish pixelmatch as a ES module. Use the older v5.3.0 if you need to support CommonJS environments.
Upgrade pngjs dependency (used in the pixelmatch CLI) from v4 to v6.
Upgrade pngjs dependency (used in the pixelmatch CLI) from v4 to v6.
Nothing published for this version
Added a diffColorAlt option for coloring pixels that got darker differently (for differentiating between "added" and "removed" parts). #87 (h/t @trist
diffColorAlt option for coloring pixels that got darker differently (for differentiating between "added" and "removed" parts). #87 (h/t @tristen)Added diffMask option. #73 (h/t @tmeasday)
Added diffMask option. #73 (h/t @tmeasday)
Fix input validation failing in some Jest environments. #62
🐞 Fix alpha option being ignored in case of identical images.
alpha option being ignored in case of identical images.⚠️ Breaking: update to ES6 syntax, dropping Node <6.4 and IE11 support.
alpha, aaColor, diffColor) (@dreignier @VP-)Fixed the command-line to properly handle the case when threshold is not provided.
Fixed the command-line to properly handle the case when threshold is not provided.
Updated dependencies (including pngjs to remove npm install warning).
pngjs to remove npm install warning).Breaking: switched to a much more accurate color difference metric based on recent research. As a side effect, the threshold scale changed — bump your
threshold scale changed — bump your old value by about ~70%.diff image creation (by passing null as the output argument)Breaking: changed the API to accept options object literal (with threshold and includeAA properties) rather than arguments.
options object literal (with threshold and includeAA properties) rather than arguments.threshold to be relative to YUV distance (not squared); this means you'll have to change the threshold values you're currently using to sqrt(threshold).Increased accuracy of anti-aliased pixels comparison.
Increased accuracy of anti-aliased pixels comparison.
Adds Node 0.10 support for command line and tests.
Adds Node 0.10 support for command line and tests.
Much more accurate anti-aliased pixels detection algorithm #2
Note a breaking API change: antialiasing argument (number, 1 by default) is replaced with includeAA (boolean, false by default). Anti-aliasing detection is still enabled by default but always happens with 1 pixel radius.
Fixed minor bug in color difference calculation.
Fixed minor bug in color difference calculation.
Use premultiplied Y'UV colorspace for color comparison, making it more in line with human perception of color.
Use premultiplied Y'UV colorspace for color comparison, making it more in line with human perception of color.
Nothing published for this version
One column per quarter.