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

Return negative colorDiff if pixel is darker #41

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Return negative colorDiff if pixel is darker #41

merged 1 commit into from
Sep 30, 2024

Conversation

lencioni
Copy link
Collaborator

I am implementing antialiasing detection in our comparison service and I need to be able to determine if the pixel is darker or lighter. We can encode this information by using a negative number if the pixel is darker, and a positive number if the pixel is lighter. We don't need this information in other places, so we can use Math.abs to normalize.

While I was at it, I switched getDiffPixel over to use colorDeltaChannels, since colorDelta is deprecated for performance reasons.

I am implementing antialiasing detection in our comparison service and I
need to be able to determine if the pixel is darker or lighter. We can
encode this information by using a negative number if the pixel is
darker, and a positive number if the pixel is lighter. We don't need
this information in other places, so we can use Math.abs to normalize.

While I was at it, I switched getDiffPixel over to use
colorDeltaChannels, since colorDelta is deprecated for performance
reasons.
@lencioni lencioni merged commit 1d2c05d into main Sep 30, 2024
1 check passed
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.

2 participants