Compare different images pixel by pixel.
http://geekplux.github.io/image-match
$ npm install image-match
import the image-match.js
to your HTML.
var similarity = imgMatch.compare(templateImg.src, matchImg.src, function (similarity) {
console.log(similarity);
});
MIT © GeekPlux