Skip to content

Instantly share code, notes, and snippets.

@ericksli
Created April 1, 2016 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericksli/ff0eded3695c59598a6c985aa7c30c55 to your computer and use it in GitHub Desktop.
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
#!/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