3 # gEDA: GNU Electronic Design Automation
4 # pstoimage (converts a postscript file to a gif)
5 # This script is placed under the GNU Public License (GPL) version 2.0
7 # This scripts creates gifs from ps files using gs and ppmtogif
8 # (both programs are REQUIRED)
10 # It's a fairly simple script designed to give an idea on how to take
11 # the output from gschem and create image files
13 # First parameter is the input filename (must be a postscript file)
14 # output filename is called `basename $1`.gif
16 # This script requires free diskspace when it runs due to ppm files being
17 # so large (don't forget to remove old ppms)
19 # I have found that ppmtogif does a poor job sometimes, so it in that case
20 # try using xv to read the image and then save it as a gif
25 echo usage
: pstoimage filename.ps
30 basename=`basename $input_filename .ps`
31 output_filename
=${basename}.gif
35 # Added a -r${resolution} if you want to control the resolution
38 # Uncomment the following line if you have Aladdin Ghostscript
39 # and want anti-aliasing enabled (replace this line with the other gs line
41 gs
-q -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
42 -dNOPAUSE -sOutputFile=$basename.ppm \
44 $input_filename quit.ps
47 ppmtogif
$basename.ppm
> $output_filename
50 # Use ImageMagic convert if you want crop the image
51 # This will create fairly big gif files
52 #convert -crop 0x0 $output_filename ${basename}_crop.gif