Visually compare two images
Visually compare two images
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
Thank you for your reply.I can't understand how you can obtain the coefficient of difference images?
Re: Visually compare two images
Tell me which option to use -metric type for the evaluation of visual changes image?
Last edited by lorents on 2015-05-31T22:37:53-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Visually compare two images
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:
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.
If the two images are the exact same size:
Code: Select all
compare -metric rmse image1 image2 differenceimage
Re: Visually compare two images
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Visually compare two images
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
Thank you very much!