Created
April 29, 2020 15:32
-
-
Save grigorye/f9bbf7f1393a5e50f77f26af8a714d70 to your computer and use it in GitHub Desktop.
Poor man's image comparator (suitable for integration with Git clients)
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/sh | |
set -euo pipefail | |
tmpdir=$(mktemp -d "/tmp/$(basename "$0").XXXXX") | |
bn1=$(basename "$1") | |
bn2=$(basename "$2") | |
diff="$tmpdir/diff-$bn1-$bn2.png" | |
~/homebrew/bin/magick compare "$1" "$2" -compose src "$diff" && true | |
open "$diff" "$1" "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment