Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce test scenes that demonstrate conflation artifacts #271

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

armansito
Copy link
Collaborator

Added two scenes that demonstrate the conflation artifact problem as described in #49. The first scene demonstrates adjacent triangles and rects that belong to the same path and use opposite winding.

The second scene demonstrates strokes with overlapping square caps (these strokes are currently expressed as rects painted with the NonZero fill rule).

@armansito armansito changed the title Introduce test scenes that demonstrates conflation artifacts Introduce test scenes that demonstrate conflation artifacts Feb 3, 2023
@armansito armansito force-pushed the pr-conflation-examples branch 2 times, most recently from ae2d537 to d2f1050 Compare February 3, 2023 17:16
Added two scenes that demonstrate conflation artifacts as described in
linebender#49. The first scene
demonstrates adjacent triangles and rects that belong to the same path
and use opposite winding.

The second scene demonstrates strokes with overlapping square caps
(these strokes are currently expressed as rects painted with the NonZero
fill rule).
@DJMcNab
Copy link
Member

DJMcNab commented Feb 3, 2023

Scene 1 conflation_artifacts (with feasibly less colourblind-unfriendly colours):
scene_1

Presumably, all three squares should be solid colour. Note that the second and third squares have an underlaid red #ff0000 background (or well #0000ff blue), whereas the first has no such underlay, so the background black is seeping through.

Scene 2 labyrinth:
image

I'm not quite sure which part of this is interesting, presumably the extensions at the intersections

@armansito
Copy link
Collaborator Author

@DJMcNab I'd be happy to change the colors for the test case if you prefer that. What you described is correct, in the conflation_artifacts scene, all 3 squares should have a solid color. This demonstrates when opposite winding at adjacent edges "cancel each other out".

The labyrinth scene, if rendered correctly, should not have the "bulging" effect where the rectangles overlap. You can see what it should look like by changing the translation offset of the labyrinth from Affine::translate((20.5, 20.5)) to Affine::translate((20., 20.)) which will cause the edges of the shapes to fall on exact pixel boundaries, leading to 100% coverage of covered pixels and will only show solid lines. Whereas the fractional offsets in the test scene lead to partial pixel coverage, which makes the artifact visible where coverage is over-counted on overlapping regions which affects the alpha mask (I believe in this case you get 100% alpha instead of 50% as with the non-overlapping edges).

@DJMcNab
Copy link
Member

DJMcNab commented Feb 3, 2023

My only experience with colourblind-friendliness is from watching Cracking The Cryptic, where they prefer to use their blue and orange colours when colouring.

I strongly suspect that red and green aren't a good set of colours to use, but I'm not certain what a good set would be.

I don't have colourblindness, so without using external tools, I can't say if the scene in this PR is accessible.

@armansito
Copy link
Collaborator Author

I changed the colors to the following. These foreground/background colors should maintain a high contrast across the types of colorblindness I'm aware of based on this tool.

Screenshot 2023-02-03 at 12 29 10 PM

Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, these are useful for showing conflation artifacts and will be helpful for verifying that attempts to remove them actually work.

@armansito armansito merged commit 2690c36 into linebender:main Feb 6, 2023
@armansito armansito deleted the pr-conflation-examples branch February 6, 2023 23:24
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.

3 participants