Repository navigation
Apply fuzz before the early identical-image check - #3
Merged
Merged
Conversation
compare's early exact pre-check ran without -fuzz, so any pixel noise (anti-aliasing, subpixel jitter) that the fuzzed compare below would treat as 'no difference' still fell through to generating a diff montage. That montage then showed nothing highlighted -- the diff was pure noise, but a diff file was still written and treated as a real difference by anything checking for its presence Move the fuzz/fuzz_flag computation above the pre-check and use 'compare -metric AE $fuzz_flag ... null:' there instead of an unfuzzed compare against /dev/null. Also drop 'File Size' from the exif fields considered meaningful: almost any byte-level difference changes the compressed size, so keeping it gated the fuzzy image pre-check behind a near-guaranteed metadata mismatch, defeating the point of the fuzz.
hannesa2
force-pushed
the
fix/fuzzy-precheck
branch
from
October 1, 2026 04:46
6db1d34 to
debcf6e
Compare
hannesa2
added a commit
to gitx/gitx
that referenced
this pull request
Oct 1, 2026
Fixes the remaining noisy-screenshot-diff problem: the early exact pre-check in diff-image ran without -fuzz and was gated on an exif diff that almost always fires because 'File Size' changes with any byte difference. Together these meant a noisy (but visually identical once fuzzed) screenshot pair still produced a diff file, even though the rendered montage showed nothing highlighted. refs: hannesa2/git-diff-image#3
hannesa2
added a commit
to gitx/gitx
that referenced
this pull request
Oct 1, 2026
Fixes the remaining noisy-screenshot-diff problem: the early exact pre-check in diff-image ran without -fuzz and was gated on an exif diff that almost always fires because 'File Size' changes with any byte difference. Together these meant a noisy (but visually identical once fuzzed) screenshot pair still produced a diff file, even though the rendered montage showed nothing highlighted. refs: hannesa2/git-diff-image#3
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.
Compare's early exact pre-check ran without
-fuzz, so any pixel noise (anti-aliasing, subpixel jitter) that the fuzzed compare below would treat as 'no difference' still fell through to generating a diff montage. That montage then showed nothing highlighted -- the diff was pure noise, but a diff file was still written and treated as a real difference by anything checking for its presence).Move the fuzz/fuzz_flag computation above the pre-check and use
compare -metric AE $fuzz_flag ... null:there instead of an unfuzzed compare against/dev/null.Also drop 'File Size' from the exif fields considered meaningful: almost any byte-level difference changes the compressed size, so keeping it gated the fuzzy image pre-check behind a near-guaranteed metadata mismatch, defeating the point of the fuzz.