Page 1 of 1

Visually compare two images

Posted: 2015-05-31T10:59:10-07:00
by lorents
Good evening! tell me how to use ImageMagick, you can visually compare two images and give a ratio difference images?

Re: Visually compare two images

Posted: 2015-05-31T11:13:01-07:00
by fmw42

Re: Visually compare two images

Posted: 2015-05-31T11:19:29-07:00
by lorents
Thank you for your reply.I can't understand how you can obtain the coefficient of difference images?

Re: Visually compare two images

Posted: 2015-05-31T13:51:26-07:00
by lorents
Tell me which option to use -metric type for the evaluation of visual changes image?

Re: Visually compare two images

Posted: 2015-05-31T13:52:04-07:00
by fmw42
The compare looks at various accumulative metrics from the pixel by pixel color difference (channel by channel) such as the absolute error, peak absolute error, mean absolute error, root mean squared error, etc. See http://www.imagemagick.org/Usage/compare/#statistics. Use Google or Wikipedia to look up the equations that are used to compute those metrics. Choose what you feel gives you the best measure of difference. I almost always use root mean squared error.

If the two images are the exact same size:

Code: Select all

compare -metric rmse image1 image2 differenceimage
The output will be an visual image and a set of numbers to the terminal. The numbers tell you how good a fix. For most metrics (such as the rmse), the smaller the number the better the match between the two images.

Re: Visually compare two images

Posted: 2015-05-31T22:41:27-07:00
by lorents
Read an article about SSIM, which is not in ImageMagic? they say it is better to use it to compare images. Tell me, is this so?

Re: Visually compare two images

Posted: 2015-06-01T09:27:21-07:00
by fmw42
I have no idea if it is better. There are many steps in that reference process, which would have to be done as preprocessing. The final step is a Minkowski error metric, which would not be hard to add to compare, but would require a define or new argument for exponent. The rmse metric is a Minkowski error metric with the exponent set to 2.

Re: Visually compare two images

Posted: 2015-06-01T10:46:09-07:00
by lorents
Thank you very much!