Page 1 of 1

compare one image with the Image Directory

Posted: 2015-08-30T01:20:23-07:00
by Sloneny
Hello.
Please tell me whether ImageMagick to compare one image with several images in the catalog.
I need to compare 9 images in the same directory with a few hundred in the other, using the command line.
I have tried so, but it does not work:
compare -metric MAE D: \ test.png D: \ testfolder null:

Re: compare one image with the Image Directory

Posted: 2015-08-30T11:01:54-07:00
by fmw42
Sloneny wrote: compare -metric MAE D: \ test.png D: \ testfolder null:

You cannot compare one image to a folder of images with the compare function. It only compares two images at a time. So you would need to write a script to loop over all the images in the directory and compare each to one of your 9 images. Then repeat for each of the other 8 images.

Also you cannot have spaces in paths.

So I believe your command for any two images should be

Code: Select all

compare -metric MAE D:\test.png D:\testfolder\image1.png null:
That assumes that test.png (one of nine) is at the root of the D directory and image1.png (one of your 500 images) is in testfolder, which is at the root of the D directory.