log compare score
Posted: 2013-01-24T05:35:29-07:00
Hello,
Im new to ImageMagick and would like to use the compare function in terminal as suggested:but I'd like to save the output score (i.e. '28.31') to a text file (or other supported filetype)
If this can be done via the terminal command that would be preferable.
I've tried and failed at doing this with a python script to execute the command and catch the output:
But the score does not come back within the 'output' return.
thanks
Im new to ImageMagick and would like to use the compare function in terminal as suggested:
Code: Select all
$ compare -metric PSNR rose.jpg reconstruct.jpg difference.png
If this can be done via the terminal command that would be preferable.
I've tried and failed at doing this with a python script to execute the command and catch the output:
Code: Select all
output = subprocess.Popen(["compare","-metric","PSNR",path + "before.jpg", path + "after.jpg", path + "difference.jpg"], stdout=subprocess.PIPE).communicate()[0]
with open(path+"scores.txt", "a") as myfile:
myfile.write(str(output))
thanks