I am looking for a program that can compare two images, and return the rate of similarity (e.g., in %).
Any license, price, and operating system is fine. I mostly interested in the quantity of the image similarity algorithm.
Software Recommendations Stack Exchange is a question and answer site for people seeking specific software recommendations. It only takes a minute to sign up.
Sign up to join this communityI am looking for a program that can compare two images, and return the rate of similarity (e.g., in %).
Any license, price, and operating system is fine. I mostly interested in the quantity of the image similarity algorithm.
You could use the morphing distance as calculated by https://github.com/kallaballa/Poppy (I am the author)
e.g. when running poppy as follows, the last line denotes the distance between the circle and square image.
src/poppy -n images/circle.png images/square.png
Which gives 0.0257155 in this example.
When comparing something more similar, like e.g. two faces:
src/poppy -n images/some1.png images/some2.png
It gives 0.00411874, which is way lower.
You can see the difference of two images using imagemagick.
Use ImageMagick® to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, GIF, HEIC, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
It works fine on Windows. See this answer at stackoverflow.com about comparing two images If the output is "1161" it's 50%. See @Mark Setchell's comment about his own answer.
@echo off
FOR /F %%G IN ('magick.exe compare -metric ae PATH_TO_YOUR_IMAGE\a.jpg PATH_TO_YOUR_IMAGE\b.jpg null:') DO @SET n=%%G
echo %percent%
Save this file as "percent.bat" or whatever you like in the same directory of magick.exe. Run it on command line. (I had to add "magick.exe" above code)
Virustotal.Com results for executables are fine, I only tested setup program and magick.exe
I have developed an image comparison algorithm for near duplicate search, which you can try online on the web-site. The corresponding program func EucMetric (Github code) returns 3 similarity metrics (one per color channel).
Current implementation is relatively strict on position/rotation/distortion etc. But by adding a sliding window with scale/position variations, it is possible to apply this algorithm to sub-regions, so that you can get a cumulative metric based on similarity of image parts.