Skip to content

Instantly share code, notes, and snippets.

@nna774
Last active August 8, 2018 12:32
Show Gist options
  • Save nna774/9b06603599bd26986126af6fa50436f4 to your computer and use it in GitHub Desktop.
Save nna774/9b06603599bd26986126af6fa50436f4 to your computer and use it in GitHub Desktop.
#! /bin/bash -e
if [ $# -ne 2 ]; then
CMD=`basename $0`
echo "$CMD A.jpg B.png" 1>&2
exit 1
fi
TMP=`mktemp --suffix=.png`
composite -compose difference "$1" "$2" "$TMP"
echo $TMP
if [ `identify -format "%[mean]" $TMP` != 0 ]; then
echo different image
exit 1
else
echo same image
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment