The result of git diff-img
. Sample image by
Muband from
the Spot the difference
Wikipedia article; distributed under a CC BY-SA 3.0 license
Install ImageMagick: sudo apt install imagemagick
.
git config --global alias.diff-img difftool\ -x\ \''compare -alpha copy "$LOCAL" "$REMOTE" png:- | montage -mode concatenate "$LOCAL" png:- "$REMOTE" png:- | display -title "$BASE: Local | Diff | Remote" png:-'\'
This is an alternative installation procedure that is unnecessary if the Git configuration is used. It's not recommended because it requires an understanding of PATH lookup
curl https://raw.githubusercontent.com/niedzielski/git-diff-img/master/git-diff-img -o ~/bin/git-diff-img &&
chmod +x ~/bin/git-diff-img
Execute against images only: git diff-img **.png
💡 Resizing the diff to fit your monitor…
Newer versions of ImageMagick support resizing the diff to fit large images to
the screen. Consider adding
the -resize
argument
to display
if you want this behavior. Eg, instead of:
display -title "$BASE: Local | Diff | Remote" png:-
Try:
display -resize 1900x -title "$BASE: Local | Diff | Remote" png:-
Version a font sprite sheet and see the concrete difference in each commit.
All code is public domain and may be used without limitation.