Repository navigation
feat: compare images with pixelmatch 8 - #1289
Merged
Merged
Conversation
pixelmatch 8 measures color differences with OKLab and HyAB instead of YIQ. The API, the threshold scale and its default did not change, so the ignore* presets keep their values; the comments and the README that described them in YIQ terms are updated. Mismatch numbers can change a little (about -3 % to +3 % on real screenshots), so the changeset is a major for v11. The public checkerboard option keeps working (pixelmatch 8 supports it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: ceb67f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
plum117
marked this pull request as ready for review
October 9, 2026 00:00
|
The other checkerboard tests mock pixelmatch, so they only check that the option is passed. A fully transparent image against an opaque white image: with checkerboard false pixelmatch blends the transparent pixels with white (no difference), with true it blends them with a checker pattern (all 256 pixels differ). The first test fails when compareImages stops passing the option; pixelmatch 7 gives the same results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the comparison engine of
@wdio/image-comparison-corefrom pixelmatch 7.2 to 8.0 (replaces Dependabot #1259), for v11.pixelmatch 8 measures color differences in the OKLab color space with the HyAB distance instead of YIQ: closer to how people see colors, with fewer false positives and fewer missed changes. The API, the
thresholdscale (0–1,1= black vs white) and its default did not change, and it still supports our publiccheckerboardoption. But mismatch numbers can change a little, so the changeset is a major (like the other v11 changes of these packages).Changes
pixelmatch^7.2.0→^8.0.0.ignore*presets keep their values (0.063,0.13,0). The comments and the README that described them in YIQ terms now describe the pixelmatch scale, and the README says that v11 uses OKLab/HyAB.@wdio/image-comparison-coreand@wdio/visual-service, with a note for users.Why pixelmatch 8 and not @blazediff/core (#1195)
Benchmark on 5 real image pairs from our runs (same page with another clock, iPhone full page with a 1-px shift, the 2 Android display states, the Android black band, Linux vs Docker fonts), with our default and
antialiasingsettings:antialiasing)checkerboard(public option since #1181)@blazediff/coreis a faithful, faster pixelmatch 7, but it would drop a public option and keep the old metric. Closing #1195 (thanks to the author) and #1259 after this PR.Test
pnpm test(lint, types, 1077 unit tests, of which 784 in image-comparison-core): pass.test.local.chrome.v10,.jasmine,.emulation,test.local.desktop.multi,test.local.desktop(setup run, then the real run, including the checks that expect a mismatch in a range): pass.compareImages.checkerboard.test.ts: the real pixelmatch on a transparent vs opaque-white image,checkerboard: false→ 0 %,true→ 100 %. It fails whencompareImagesstops passing the option; pixelmatch 7 gives the same results.🤖 Generated with Claude Code