Skip to content

Replace Jimp#1152

Merged
wswebcreation merged 18 commits into
ws/investigate-flakinessfrom
ws/replace-jimp
Jun 27, 2026
Merged

Replace Jimp#1152
wswebcreation merged 18 commits into
ws/investigate-flakinessfrom
ws/replace-jimp

Conversation

@wswebcreation

Copy link
Copy Markdown
Member

Why

jimp is no longer actively maintained, t has seen no releases in over a year and shows minimal PR/issue activity. It was originally chosen to avoid the system-level install requirements of node-canvas (GTK, Cairo, etc.), but it now carries its own maintenance risk.

This PR replaces jimp with an approach that keeps the same guarantee, no binary dependencies, no OS-level installs, pure JavaScript, while using actively maintained libraries. The image codec is replaced by fast-png (v8.0.0, maintained by the image-js / Zakodium org), and all image manipulation operations are implemented as a small in-house utility module that operates directly on raw RGBA pixel buffers.

User impact

There are no intentional behaviour changes for end users. The visual comparison results, blockout regions, full-page screenshot assembly, and device rotation handling all operate identically. The compareEngine the is introduced in the branch we are going merge this in will be removed. We believe that we can merge this as a major release without too much impact for users.

Baseline compatibility

This PR is being validated against baselines that were originally generated with jimp to confirm that the pixel-level output of the new implementation is identical. Any regression there would indicate a bug in the pure-JS pixel operations (crop, composite, rotate, resize) that needs to be addressed before merging.

@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 63ee9ad

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wswebcreation wswebcreation marked this pull request as ready for review June 27, 2026 04:50
@wswebcreation wswebcreation merged commit 663ce4f into ws/investigate-flakiness Jun 27, 2026
5 of 10 checks passed
@wswebcreation wswebcreation deleted the ws/replace-jimp branch June 27, 2026 04:51
wswebcreation added a commit that referenced this pull request Jun 28, 2026
* feat: add compareEngine option and pixelmatch dependency

* feat: add pixelmatch adapter and wire into executeImageCompare

* test: add unit tests for pixelmatch adapter and compareEngine routing

* chore: upgrade pixelmatch to v7.2.0

* fix: scope compareEngine to service level only

* fix: normalize image dimensions before pixelmatch comparison

* fix: align pixelmatch threshold with resemble and use consistent diff color

* fix: replace contain() with buffer-level padding to prevent top-line artifact

* fix: use Math.ceil for ignored region size and increase bidi padding

* Merge branch 'main' into ws/investigate-flakiness

* Replace Jimp (#1152)

* refactor: remove resemble engine and make pixelmatch the sole comparison engine

* feat: add fast-png dependency and imageUtils pure-JS pixel utility module

* chore: linting fix

* chore: add missing coverage

* feat: overlay diff pixels on actual screenshot and eliminate intermediate PNG encode/decode

- fix restore blockout transparency and correct landscape bezel rotation
-

* chore: add new temp images

* chore:now use the pixelmatch not layout testing baseline

* tests: fix tests

* Merge branch 'main' into ws/replace-jimp

* chore: add cron option to enable/disable trigger

* chore: fix flow

* Merge branch 'main' into ws/replace-jimp

* Merge branch 'main' into ws/replace-jimp

* Merge branch 'ws/investigate-flakiness' into ws/replace-jimp

* fix: fix ocr test

* chore: fix OCR test

* chore: remove images

* chore: revert lt config

* Merge branch 'main' into ws/investigate-flakiness

* chore: updated config

* chore: new baseline images

* chore: add changeset

* chore: update pipeline config for stability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant