Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

ImageMagick - Image Comparison

$
0
0

Hello,

 

I have successfully used the Image Magick object to convert an image into another format: 

Func _ImageMagick_Convert($infile, $outfile) local $o_object; local $rc; $o_object = ObjCreate("ImageMagickObject.MagickImage.1") If Not IsObj($o_object) Then Return 0 endif $rc = $o_object.Convert($infile, $outfile) Return 1 EndFunc

I now wish to use Image Magick's compare functionality to obtain an 'overall image distortion'. I have found the code for this here: 

 

http://www.imagemagick.org/script/compare.php

 

However, I am unable to get the code to work:

 

Plain Text         
Func _Compare_Image($fileOne, $fileTwo, $result) local $o_object; local $rc; $o_object = ObjCreate("ImageMagickObject.MagickImage.1") If Not IsObj($o_object) Then Return 0 endif $rc = $o_object.Compare("-metric", "PSNR", $fileOne, $fileTwo, $result) Return $rc EndFunc $test = Call("_Compare_Image", "Sample One.png", "Sample Two.png", "Result.png") ConsoleWrite($test)

I am not sure how to pass the -metric PSNR method.  Can anyone help? 

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>