I was wondering if there were any users familiar with both the unix and windows side of imagemagick so that I could get this code:
Code: Select all
infile="jyeO6.gif"
inname=`convert $infile -format %t info:`
ww=10
hh=100
hist=`convert $infile -format %c histogram:info:- | sort -k 1 | sed -n 's/^ *\(.*\)$/\1/p'`
echo "hist=$hist"
string=""
colorArr=(`echo "$hist" | sed -n 's/^.*#.* \(.*\)$/\1/p'`)
echo "colors=${colorArr[*]}"
nc=${#colorArr[*]}
nc1=$((nc-1))
echo "nc=$nc"
countArr=(`echo "$hist" | sed -n 's/^\(.*\):.*$/\1/p'`)
echo "counts=${countArr[*]}"
maxcount=${countArr[$nc1]}
echo "maxcount=$maxcount"
string=""
for ((i=0; i<nc; i++)); do
ht=`convert xc: -format "%[fx:round(100*${countArr[i]}/$maxcount)]" info:`
string="$string -size ${ww}x${ht} xc:${colorArr[i]}"
done
echo "string=$string"
convert -size ${ww}x${hh} $string -background black +append -flip ${inname}_colorhist.gif
I would really appreciate your help!
Thanks a bunch!