Skip to content

Conversation

@coreh
Copy link

@coreh coreh commented Jul 26, 2019

Hey there 👋

While comparing images produced by two different computers via WebGL, we noticed that sometimes the images would include 1px-2px thick spurious diff regions, likely caused by differences in rasterization and floating point precision between GPU models.

pixelmatch already includes antialias detection which helps alleviate some of these false-positives, but in some cases they were still showing up in our image diffs.

This PR introduces logic to optionally apply an erosion morphological operation after calculating the diff — which eliminates 1-2px wide structures from the image diff — and to return the total of non-eroded pixels.

Erosion is implemented as a separate pass, so it requires the output image to be present. By default eroded pixels are marked with an orange color.

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