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