#!/bin/sh # # flicker_cmp [options] image1 image2 ... # # Generate and display an animation of the images given with 1/2 second delay # so that you can see and compare the very slight differences between the two # images. A label is added to the image so you know which image is which. # # OPTIONS # -d delay the delay for each frame in centi-seconds (def = 50) # -r size resize image to this size (pixels or percentage) # -s size scale image to this size (pixels or percentage) # ### # # Anthony Thyssen 5 September 2007 # PROGNAME=`type $0 | awk '{print $3}'` # search for executable on path PROGDIR=`dirname $PROGNAME` # extract directory of program PROGNAME=`basename $PROGNAME` # base name of program Usage() { # output the script comments as docs echo >&2 "$PROGNAME:" "$@" sed >&2 -n '/^###/q; /^#/!q; s/^#//; s/^ //; 3s/^/Usage: /; 2,$ p' \ "$PROGDIR/$PROGNAME" exit 10; } resize='' delay=50 while [ $# -gt 0 ]; do case "$1" in --help|--doc*) Usage ;; -d) shift; delay="$1" ;; # animation delay -r) shift; resize="-resize $1" ;; # resize image to this size -s) shift; resize="-scale $1" ;; # scale image to this size -) break ;; # STDIN, end of user options --) shift; break ;; # end of user options -*) Usage "Unknown option \"$1\"" ;; *) break ;; # end of user options esac shift # next option done convert -label "%f" "$@" $resize miff:- |\ montage - -geometry +0+0 -tile 1x1 -background none miff:- |\ animate -dispose background -delay "$delay" -loop 0 -