Provide a global tolerance when comparing for equality#36
Open
cburgmer wants to merge 3 commits intoHumbleSoftware:v1.1from
Open
Provide a global tolerance when comparing for equality#36cburgmer wants to merge 3 commits intoHumbleSoftware:v1.1from
cburgmer wants to merge 3 commits intoHumbleSoftware:v1.1from
Conversation
Contributor
Author
|
My thoughts: I did want to follow your suggestion and see how things pan out. However, I am not happy with the API. There are a few things:
Will try to come up with an alternative idea. |
Contributor
Author
|
Here's my current proposal: and |
Member
|
Can you give me an example of relativePerPixel? Would that be a total difference of 5 across the rgba values for a single pixel? |
Contributor
Author
|
Sorry for the late response.
I'm not sure about the proposed API anymore though. I think it would be easier if we'd provide a method on it's own for the different tolerances? |
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.
This PR tries to solve #18.
As proposed it implements an optional parameter set along the following example:
Following those changes
imagediff.equal(a, b, 128)would be expressed throughimagediff.equal(a, b, {tolerance: 0.5})in the future (however the old API remains intact).A global tolerance can be given through adding
totalTolerance: trueto the option object.