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 -s, --size=SIZE set papersize
15 -t, --transparent change white to transparent
27 while [ $# -gt 0 ]; do
32 color
='-transparent white'
43 --o*=*) OUTFILE
=`echo $opt | sed -e s/"^.*="//`
49 -s) SIZE
="-sPAPERSIZE=$2"; shift
52 SIZE
="-sPAPERSIZE=`echo $opt | sed -e s/"^.
*="//`"
55 echo "ps-to-gifs: unknown option: \`$opt'"
64 if [ "x$TRANSPARENT_IS_BROKEN" != "x" ]; then
68 if [ "x$OUTFILE" = "x" ]; then
69 BASE
=`dirname $FILE`/`basename $FILE .ps`
71 BASE
=`dirname $OUTFILE`/`basename $OUTFILE .$GIF`
75 rm -f $BASE{.ppm
,.
$GIF} $BASE-page*{.ppm
,.
$GIF}
77 # generate the pixmap at twice the size, then rescale (for antialiasing)
78 cat $FILE | gs
-sDEVICE=ppmraw
$SIZE -sOutputFile="$BASE-page%d.ppm" -r180 -dNOPAUSE - -c quit
$FILE
80 # cat $PPMFILE | ppmquant 2 | pnmscale 0.3333 | pnmcrop | $PNMTOGIF $color > $OUTFILE
83 o
=`dirname $i`/`basename $i .ppm`.
$GIF
84 cat $i | pnmscale
0.5 |
$CROP |
$PNMTOGIF $color > $o
88 if [ "x$OUTFILE" != "x" ]; then
89 mv $BASE-page1.
$GIF $BASE.
$GIF