Created
April 1, 2016 02:13
-
-
Save ericksli/ff0eded3695c59598a6c985aa7c30c55 to your computer and use it in GitHub Desktop.
Diff PNG files between two folders and list out the images that are different using ImageMagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
files=`find $1/*.png` | |
while read -r srcfile; do | |
name=`basename $srcfile` | |
targetfile="${2}/${name}" | |
result=`compare -metric RMSE $srcfile $targetfile /dev/null 2>&1;` | |
if [[ $result != 0* ]]; then | |
echo "${name} = ${result}" | |
fi | |
done <<< "$files" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment