gsch2pcb: Make --m4-file and -m4-pcbdir arguments work again.
[geda-gaf/peter-b.git] / utils / scripts / gpstoimage
blobf06521b7ef7b2e68476b4f0ea7bce9164083f77e
1 #!/bin/sh
3 # gEDA: GPL 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
23 if [ "$1" = "" ]
24 then
25 echo usage: pstoimage filename.ps
26 exit 0
29 input_filename=$1
30 basename=`basename $input_filename .ps`
31 output_filename=${basename}.gif
32 #resolution=100
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
40 #gs -r200 -q \
41 gs -q -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
42 -dNOPAUSE -sOutputFile=$basename.ppm \
43 -sDEVICE=ppm \
44 $input_filename quit.ps
46 # ppm to gif
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