2 # ps-to-gifs, convert PS to multiple gifs or other bitmaps
7 Convert PS to multiple gifs or other bitmaps
8 Usage: ps-to-gifs.sh [OPTION]... [FILE]
11 -c, --crop crop output
12 -o, --output=NAME set output base
13 -p, --png convert to png
14 -t, --transparent change white to transparent
26 while [ $# -gt 0 ]; do
31 color='-transparent white'
42 --o*=*) OUTFILE=`echo $opt | sed -e s/"^.*="//`
49 echo "ps-to-gifs: unknown option: \`$opt'"
58 if [ "x$TRANSPARENT_IS_BROKEN" != "x" ]; then
62 if [ "x$OUTFILE" = "x" ]; then
63 BASE=`dirname $FILE`/`basename $FILE .ps`
65 BASE=`dirname $OUTFILE`/`basename $OUTFILE .$GIF`
69 rm -f $BASE{.ppm,.$GIF} $BASE-page*{.ppm,.$GIF}
71 # generate the pixmap at twice the size, then rescale (for antialiasing)
72 cat $FILE | gs -sDEVICE=ppmraw -sOutputFile="$BASE-page%d.ppm" -r200 -dNOPAUSE - -c quit $FILE
74 # cat $PPMFILE | ppmquant 2 | pnmscale 0.3333 | pnmcrop | $PNMTOGIF $color > $OUTFILE
77 o=`dirname $i`/`basename $i .ppm`.$GIF
78 cat $i | pnmscale 0.5 | $CROP | $PNMTOGIF $color > $o
82 if [ "x$OUTFILE" != "x" ]; then
83 mv $BASE-page1.$GIF $BASE.$GIF