Assigning compare output to a variable
Posted: 2015-09-24T05:48:26-07:00
I'm running a script to compare images but want the script to do things based on the level of difference. How on earth so I assign the output of the compare command to a variable, and if possible convert it to an integer (rounded or truncated, it doesn't really matter)? So far I have tried various syntax for treating it like a normal operation. None have worked.
I'm running a Linux terminal window on Ubuntu 14.04
I have tried
difference=$((compare -metric PSNR file1.png file2.png diff.png))
and
difference=`compare -metric PSNR file1.png file2.png diff.png`
and various others.
I'm running a Linux terminal window on Ubuntu 14.04
I have tried
difference=$((compare -metric PSNR file1.png file2.png diff.png))
and
difference=`compare -metric PSNR file1.png file2.png diff.png`
and various others.