Image similarity in JavaScript

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:

Here you can find an in depth discussion of the algorithm:


2 thoughts on “Image similarity in JavaScript

  1. rahul kotte

    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

  2. bitlyfied Post author

    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

    for calculating an exact diff of two images there’s already a good library called js-imagediff:

    guess what: someone already built with it a framework to test regression’s on screenshots:

    see you soon!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s