Skip to content

Add support for images#156

Draft
mkutz wants to merge 6 commits intomainfrom
152-add-support-for-images
Draft

Add support for images#156
mkutz wants to merge 6 commits intomainfrom
152-add-support-for-images

Conversation

@mkutz
Copy link
Owner

@mkutz mkutz commented Nov 19, 2025

  • Add basic pixel-wise comparisson
  • Make reviewing work with images
  • Add isMoreDifferentThan to reduce effort

@mkutz mkutz linked an issue Nov 19, 2025 that may be closed by this pull request
@mkutz mkutz force-pushed the 152-add-support-for-images branch from 60ca96e to c9c20e8 Compare November 19, 2025 08:52
@mkutz mkutz force-pushed the 152-add-support-for-images branch 2 times, most recently from 91746db to 8a1e72e Compare December 1, 2025 14:56
@mkutz mkutz force-pushed the 152-add-support-for-images branch from 8a1e72e to fb2088a Compare February 4, 2026 08:00
mkutz added 3 commits February 5, 2026 19:41
Replace flaky pixel-by-pixel comparison with perceptual hashing (pHash)
as the default image comparison strategy. pHash is robust to
antialiasing, font rendering variations, and minor visual differences.

New features:
- ImageComparator interface with pluggable comparison strategies
- PerceptualHashComparator using DCT algorithm (default, 90% threshold)
- PixelComparator for exact-match use cases (1% threshold)
- approveImage(byte[]) overload for direct use with Playwright/Selenium
- byFile() convenience method matching text approval API
- Configurable thresholds via withThreshold() fluent method

Documentation:
- New Images chapter covering comparators, thresholds, and best practices
- Examples for both Playwright and Selenium
- Tips for handling animations, dynamic content, and rendering differences
The CSS selector ".version" does not match any element on
approvej.org. The version is rendered by Asciidoctor as
<span id="revnumber">, so use "#revnumber" instead.
Add ImageScrubbers factory with region() and regions() methods to
mask rectangular areas in screenshots before comparison. Integrate
via ImageApprovalBuilder.scrubbedOf(). Clean up received files on
successful approval in ImageFileApprover.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
76.7% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@mkutz mkutz changed the title 152 add support for images Add support for images Feb 11, 2026
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.

Add support for images

1 participant