I wrote a little piece of JavaScript to calculate if two images are similar.
The algorithm is fairly simple, but it seems to do a decent work.
It correctly matches images with different scaling, different saturation, some blurring, different compression rates.
More details about the library can be found on its Github page:
https://github.com/bitlyfied/js-image-similarity
Here you can find an in depth discussion of the algorithm:
http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
Hey Congratz man, Just found out that you are joining AAMedia, I am very happy for you. When are you starting.
By the way a cool way to test screenshots. So how do we use this piece of JS.
cheers, Rahul
hey man! thanks, I’m starting on Monday.
actually, it’s not a good fit for testing screenshots regression.
this is a very fast, but fuzzy algorithm. it helps finding similar images quickly, something like Google Search by Image http://www.google.com/insidesearch/features/images/searchbyimage.html
for calculating an exact diff of two images there’s already a good library called js-imagediff: https://github.com/HumbleSoftware/js-imagediff/
guess what: someone already built with it a framework to test regression’s on screenshots:
https://github.com/cburgmer/csscritic
see you soon!