Comments (6)
This is because the two images are quite different (switch between the two images — all the letters shift positions in various degrees). Blink-diff's algorithm is very naive and will ignore any differences if it can find the original pixel somewhere in the vicinity, but this can lead to many false negatives (undetected mismatches) that this library avoids. So it's more of a design decision — it does a pixel-perfect comparison.
from pixelmatch.
- Is the same true for the
resemblejs
algorithm? - The purpose of my usage is to diff front end components screenshotted via selenium. Do you think it's possible to achieve what I'm looking for in terms of diff clarity with
pixelmatch
? I'm wondering if theblink-diff
algorithm, while naive, suits my needs better due to the nature of the tests as seen above.
from pixelmatch.
To make the diff clearer, try increasing the threshold for pixelmatch. I believe resemble-js isn't very sensitive to differences as well. It can be good enough if you want to detect really noticeable differences like a huge object absent on one of the images, but the goal of this library was to create a very sensitive library suitable for testing a graphics-heavy map rendering engine across platforms.
from pixelmatch.
@nathanmarks ah damn, now I see what's going on. The two images you compare have different dimensions — the first is 156px width and the second 154px. This breaks the comparison completely because the pixel positions are shifted. I think I need to add a warning to the command line tool if the dimensions of two images don't match.
from pixelmatch.
Is it possible to anchor the smaller image? This is the two images in photoshop with layer mode difference and 58% opacity:
from pixelmatch.
@nathanmarks possible, but I'd like to keep the tool simple. I think it's fair to require equal dimensions, and if someone wants a workaround, you can always slice the image data in a way you need.
from pixelmatch.
Related Issues (20)
- Comparing two pictures with different text returns no diff HOT 2
- View
- Sam
- Avoid generating diff images with no differences in it
- way to merge the diff HOT 1
- Image accuracy
- Weird comparator behaviour. HOT 1
- True or false for same image? HOT 2
- How can I group the differences or determine if there is a common change among them? HOT 1
- install in browser not work HOT 3
- Change Rate Limit Request HOT 1
- Can you provide an executable file for a windows? HOT 1
- can i get quantitative value? HOT 1
- CDN script error: module not defined HOT 2
- Following the doc but "Image data: Uint8Array, Uint8ClampedArray or Buffer expected." is still thrown. HOT 2
- CommonJS based require throws error HOT 1
- PixelMatch leakinng Data Buffer HOT 1
- Typescript support
- Allow diffMaskColor as an option
- pixelmatch not working properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixelmatch.