#!/bin/sh # syntax: $0 # Christopher Alexander North-Keys # Incept: 2002-11-06 06:30:39 CST (Nov Wed) 1036585839 inner="'#000000'" outer="'#ffffff'" if [ _"$1" = _"-invert" ] ; then outer="'#000000'" inner="'#ffffff'" shift fi size=$1 outfile=$2 threshold= case $outfile in *.gif) threshold='-threshold 45000' ;; esac p0=`perl -e 'print(int('$size' / 2 - 1));'` p1=`perl -e 'print(int('$size' / 2 ));'` case $outfile in *.gif) rad=`perl -e 'print('$size' / 2 - 2);'` ;; *.png) rad=`perl -e 'print('$size' / 2 - 2);'` ;; esac min=`perl -e 'print('$p0' - '$rad');'` max=`perl -e 'print('$p1' + '$rad');'` echo convert -geometry ${size}x${size} \ -fill "$outer" \ -draw "'"rectangle 0 0 $size $size"'" \ -fill "$inner" \ $(for c in \ "$p0 $p0 $min $p0" \ "$p0 $p1 $min $p1" \ "$p1 $p0 $max $p0" \ "$p1 $p1 $max $p1" ; do echo ' '-draw "'"circle $c"'" ; done) \ $threshold \ blackpixel.gif $outfile | sh #----------------------------------------------------eof