#!/bin/bash
#		  /usr/local/bin/dosig
# http://crystalfaeries.net/posix/bin/dosig
# http://www.linuxmagazine.com/ Volume 8 Issue 8 Page 19 by Jerry Peek http://jpeek.com/contact.html

# dosig - make multiple -sigmoidal-contrast adjustments on file named in $1 by calling makesig() repeatedly,
# and create histogram file of the original.
base=${1%.*}	# $1 without extension
convert "$1" \
\( $(makesig $base 0.5 50) \) \
\( $(makesig $base  2  50) \) \
\( $(makesig $base  5  50) \) \
\( $(makesig $base  8  50) \) \
\( $(makesig $base 10  50) \) \
histogram:- | convert - ${base}_histogram.png


syntax highlighted by Code2HTML, v. 0.9.1