Skip to content

Instantly share code, notes, and snippets.

@carlos22
Last active December 18, 2025 18:56
Show Gist options
  • Select an option

  • Save carlos22/13bac568f7ec8749b6e06c1142866ba4 to your computer and use it in GitHub Desktop.

Select an option

Save carlos22/13bac568f7ec8749b6e06c1142866ba4 to your computer and use it in GitHub Desktop.
slight modification of: https://freakspot.net/en/git-diff-for-images/ requires imv
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
compare $2 $1 png:- | montage -border 2 -bordercolor black -geometry +4+4 $2 - $1 png:- | imv_config="${SCRIPT_DIR}/git-imgdiff-imv-config" gitimgdiff_file="$1" imv -f -d -w $1 -
[options]
overlay = true
overlay_text = $(echo -e "Filename: ${gitimgdiff_file}\nZoom: ${imv_scale}%")
[binds]
a = exec git add ${gitimgdiff_file}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment