$magick> compare -metric PSNR rose.jpg reconstruct.jpg difference.png28.31
If the reconstructed image is a subimage of the image, the compare program returns the best match offset. In addition, it returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between:
-$magick> compare -metric RMSE logo.png wizard.jpg similarity.gif85.05 (0.00129778) @ 353,157
+$magick> compare -metric RMSE -subimage-search logo.png wizard.jpg similarity.gif85.05 (0.00129778) @ 353,157
You can find additional examples of using compare in Graphics from the Command Line. Further discussion is available in More Graphics from the Command Line and Examples of ImageMagick Usage.