-
Notifications
You must be signed in to change notification settings - Fork 307
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
Detect difference between white and transparent pixels #26
Comments
It seems this is the same bug as #21. Can't tell from the discussions why that issue was closed... |
Pixelmatch measures visual difference, not numeric one, so it blends all transparent/semi-transparent pixels over a white background. If you have transparent pixels mixed with white pixels on a white background, you won't see the difference, so neither does pixelmatch. Would it help to introduce an option to set a different default background to blend images to? |
Hi! |
Is this something that could be implemented? And would it have any speed-implications? |
Yes, I think a checkerboard-style background would be possible and likely not impacting speed — let's look into that! Maybe we should change the white blending color to gray as a first simple step though since it's less likely to go unnoticeable. |
Okay, so I can't say I understand the inner workings of Pixelmap, but after messing around a little bit with the source I have managed to make it do what I want, i think.
This is just an intuitive hack from my side, and I'm not sure if it has any unwanted side-effects. |
Have you had time to try out my fix? :) |
Any updates on this? |
…allow-for-custom-snapshots-dir to master * commit 'cb529963b7f00c6c1be2a43bf4a7a815e611a0f0': fix(configureToMatchImageSnapshot): add ability to have common customSnapshotsDir
It seems like pixelmatch always returns 0 diff when comparing two images that only contain white pixels and transparency. I noticed this when trying to compare two white logo pngs. Pixelmatch doesn't care if i transform, rotate or draw more white on my logo, it still says 0 diff to the original. If I do the same experiment with a colored image it behaves as intended.
The text was updated successfully, but these errors were encountered: