Skip to content

Add GIT_DIFF_IMAGE_FUZZ env var to fuzz all image comparisons - #2

Merged
hannesa2 merged 1 commit into
masterfrom
feat/png-fuzz-env-var
Sep 30, 2026
Merged

hannesa2 merged 1 commit into
masterfrom
feat/png-fuzz-env-var

Conversation

@hannesa2

Copy link
Copy Markdown
Owner

diff-image already supports a -f option, defaulting it to 5% for JPEGs only. PNG screenshot comparisons had no way to apply fuzz, so harmless per-run rendering noise (anti-aliasing, subpixel jitter) was always flagged as a difference.

git_diff_image, the driver used by 'git diff-image', now reads GIT_DIFF_IMAGE_FUZZ and forwards it as -f to diff-image, so callers can opt PNGs (or any format) into fuzzy comparison, e.g.:

GIT_DIFF_IMAGE_FUZZ=5 git diff-image

diff-image already supports a -f <fuzz> option, defaulting it to 5% for
JPEGs only. PNG screenshot comparisons had no way to apply fuzz, so
harmless per-run rendering noise (anti-aliasing, subpixel jitter) was
always flagged as a difference.

git_diff_image, the driver used by 'git diff-image', now reads
GIT_DIFF_IMAGE_FUZZ and forwards it as -f to diff-image, so callers can
opt PNGs (or any format) into fuzzy comparison, e.g.:

    GIT_DIFF_IMAGE_FUZZ=5 git diff-image
@hannesa2
hannesa2 merged commit 7696ac7 into master Sep 30, 2026
2 checks passed
@hannesa2
hannesa2 deleted the feat/png-fuzz-env-var branch September 30, 2026 08:11
hannesa2 added a commit to gitx/gitx that referenced this pull request Sep 30, 2026
Add GIT_DIFF_IMAGE_FUZZ env var to fuzz all image comparisons

refs: hannesa2/git-diff-image#2
refs: hannesa2/screenShotScript#3
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