summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-06-24 22:37:15 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-06-24 22:37:15 +0200
commit8d2a15a0b1c4399060fd84fabfb5213c34ad337a (patch)
tree79fd8f01cdd637a4be0c5eb4d1deadd72c1e5545
parent5c0664376fdb9dbf279b53da16b8298154bada88 (diff)
downloaddotfiles-8d2a15a0b1c4399060fd84fabfb5213c34ad337a.tar.gz
dotfiles-8d2a15a0b1c4399060fd84fabfb5213c34ad337a.tar.xz
dotfiles-8d2a15a0b1c4399060fd84fabfb5213c34ad337a.zip
Bash config: add img-diff function (powered by ImageMagick)
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index 40fda99..dfd4cee 100644
--- a/.bashrc
+++ b/.bashrc
@@ -67,3 +67,12 @@ hist-grep () {
hist-del-last # omit hist-grep invocation
grep $* -- ~/.bash_history
}
+
+img-diff () {
+ [ $# -ne 2 ] && echo "usage: $FUNCNAME 1st-img 2nd-img" && return
+ #xloadimage <(gm compare "$1" "$2" -highlight-color red -highlight-style threshold -file -)
+ #xloadimage <(compare "$1" "$2" -highlight-color violet -lowlight-color darkgray -compose threshold -)
+ #xloadimage <(compare "$1" "$2" -highlight-color violet -lowlight-color darkgray \
+ # -compose threshold jpg:- | convert jpg:- -fuzz 2% -fill red -opaque '#915e99' png:-)
+ xloadimage <(compare "$1" "$2" -highlight-color violet -lowlight-color darkgray -compose threshold -)
+}