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