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

Avoid generating diff images with no differences in it #120

Open
abbrechen opened this issue Oct 20, 2022 · 0 comments
Open

Avoid generating diff images with no differences in it #120

abbrechen opened this issue Oct 20, 2022 · 0 comments

Comments

@abbrechen
Copy link

abbrechen commented Oct 20, 2022

Hi,

not sure if this is already a feature and I just didn't find it in the documentation and generated diff object properties after the function analysis, but it would be good to have the information if the software has found differences between the two images. If there are no differences, I would like to avoid saving these images.

Maybe something like

var diffImg = pixelmatch(img1, img2, diff, 800, 600, {threshold: 0.1, GenerateNoDiff: true});
// if "GenerateNoDiff" is set to false and no diff was found, the function returns null. If differences were found, it returns the regular obj
// if "GenerateNoDiff" is set to to true, the function always returns the obj

or maybe as part of the generated obj

var diffImg = pixelmatch(img1, img2, diff, 800, 600, {threshold: 0.1});
// diffImg.diff will be true if differences were found or false, if no differences were found

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants