npm / pixelmatch
pixelmatch
What changed in pixelmatch 5 to 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
6 breaking7 new APIs and options5 performance1 behavior and defaults6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpixelmatch 85 changes
Breaking changes 1
Color comparison now uses OKLab and HyAB instead of YIQ, changing diff counts to better match perceived color differences.
New APIs and options 2
Adds a per-pixel mask for skipping areas such as timestamps or animations.
Returns the largest number of differing pixels in any N×N square instead of the total count, helping distinguish compact changes from scattered noise.
Fixes and other changes 2
Anti-aliasing detection is more reliable on images with transparency.
Colors that differ only in transparency are much less likely to be missed.
pixelmatch 78 changes
Breaking changes 1
Semitransparent pixels are now blended with an irregular pattern instead of white, making transparent-versus-white differences easier to catch.
New APIs and options 1
Controls whether semi-transparent pixels are blended against a checkerboard pattern (true, the default) or plain white (false, the pre-v7 behavior) when comparing images.
Performance 3
Performance improves by approximately 8%.
Diff generation performance is significantly improved.
Match performance improves by about 6%.
Behavior and default changes 1
Antialiasing checks are skipped when includeAA is true.
Fixes and other changes 2
Errors on image size mismatch are clearer.
Options now use the default value when undefined is passed explicitly.
pixelmatch 61 changes
Breaking changes 1
Published as an ES module; CommonJS environments must use v5.3.0.
pixelmatch 511 changes
Breaking changes 3
The CLI returns a non-zero exit code when images differ.
IE11 is no longer supported.
Node versions earlier than 6.4 are no longer supported.
New APIs and options 4
Diff output is optional in the CLI.
Adds aaColor as a configurable diff output option.
Adds alpha as a configurable diff output option.
Adds diffColor as a configurable diff output option.
Performance 2
Detailed comparison is bypassed when image data is identical, improving performance when running tests on CI.
Matching performance improves by approximately 35%.
Fixes and other changes 2
Fixes anti-aliasing detection on image edges.
Produces a meaningful error when image data is in the wrong format.