You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: anti-aliasing needs the darkest or brightest sibling to repeat in both images - #188
(min_has_siblings_baseormax_has_siblings_base) and
(min_has_siblings_compormax_has_siblings_comp)
but the comment above it, and the detector it follows (pixelmatch does the same), say the pixel is anti-aliased when either the darkest or the brightest sibling has 3+ equal neighbours in both images:
(min_has_siblings_baseandmin_has_siblings_comp) or
(max_has_siblings_baseandmax_has_siblings_comp)
The current expression also accepts the darkest sibling repeating only in the base image and the brightest only in the compared one, so real changes get dropped as anti-aliasing. In this 5x5 pair, pixel (4, 2) goes from black to red and odiff --aa reports 4 different pixels instead of 5 (pixelmatch: 5):
base comp
K G R K G K G W K G
W K G G G G K G G G
W K R G K W K R K R <- (4, 2): K -> R
K G R W K K G R W K
R W W W K R W W W W
On images/www.cypress.io.png vs www.cypress.io-1.png with --aa, main counts 924818 different pixels, this branch 927138, pixelmatch 5.3.0 (includeAA: false) 927205. donkey and tiger change by 0 and 4 pixels.
The two images above are added under test/aa/, and the new test "antialiasing: a sibling needs equal neighbours in both images" fails without the change (expected 5, found 4). zig build test-integration: 46 of 47 passed, 1 skipped, as on main plus the new test; the existing anti-aliasing tests keep their counts. On 300 random PNG pairs at five thresholds, with and without --aa, odiff and pixelmatch agree on 599 of 600 counts both before and after; the remaining one is a pixel whose neighbour has the same brightness but a different color (pixelmatch counts equal brightness, odiff equal color).
Summary by CodeRabbit
Bug Fixes
Improved antialiasing detection so sibling support must match for the same brightness extreme in both images, preventing some real image changes from being overlooked.
Tests
Added a regression test confirming mismatched sibling-neighbor evidence is counted as a real change.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 4c21a87f-ffe4-43ac-b4e4-51c4fd611257
📥 Commits
Reviewing files that changed from the base of the PR and between 6dd1e96 and e6e428f.
⛔ Files ignored due to path filters: 2
test/aa/siblings-base.png is excluded by !**/*.png
test/aa/siblings-comp.png is excluded by !**/*.png
📒 Files selected for processing: 2
src/antialiasing.zig
src/test_core.zig
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
detect now requires matching-sibling support for the same brightness extreme in both images. A regression test checks the diff count when the images have mismatched sibling evidence.
Changes: Antialiasing check
Layer / File(s)
Summary
Detection condition and regression test src/antialiasing.zig, src/test_core.zig
detect now checks the same brightness extreme in both images. The regression test expects 5 differing pixels when sibling evidence differs.
The change addresses the reported anti-aliasing misclassification, and the regression test distinguishes the old behavior. No issue remains that should delay merging.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and accurately summarizes the main anti-aliasing fix. It identifies the darkest or brightest sibling requirement and its repetition in both images.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
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
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.
With
--antialiasing,detectreturnsbut the comment above it, and the detector it follows (pixelmatch does the same), say the pixel is anti-aliased when either the darkest or the brightest sibling has 3+ equal neighbours in both images:
The current expression also accepts the darkest sibling repeating only in the base image and the brightest only in the compared one, so real changes get dropped as anti-aliasing. In this 5x5 pair, pixel (4, 2) goes from black to red and
odiff --aareports 4 different pixels instead of 5 (pixelmatch: 5):On
images/www.cypress.io.pngvswww.cypress.io-1.pngwith--aa, main counts 924818 different pixels, this branch 927138, pixelmatch 5.3.0 (includeAA: false) 927205.donkeyandtigerchange by 0 and 4 pixels.The two images above are added under
test/aa/, and the new test "antialiasing: a sibling needs equal neighbours in both images" fails without the change (expected 5, found 4).zig build test-integration: 46 of 47 passed, 1 skipped, as on main plus the new test; the existing anti-aliasing tests keep their counts. On 300 random PNG pairs at five thresholds, with and without--aa, odiff and pixelmatch agree on 599 of 600 counts both before and after; the remaining one is a pixel whose neighbour has the same brightness but a different color (pixelmatch counts equal brightness, odiff equal color).Summary by CodeRabbit