[4745] in RedHat Linux List
Re: producing GIFs using ghostscript-3.33-3
daemon@ATHENA.MIT.EDU (Jon Klaren)
Sat Nov 16 23:43:09 1996
Date: Sat, 16 Nov 1996 20:40:31 -0800
To: redhat-list@redhat.com, redhat-digest@redhat.com
From: Jon Klaren <jklaren@qualcomm.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
On Sun, 17 Nov 1996 10:40:13 +1100 (EST)
Robert Hart <hartr@interweft.com.au> wrote:
>On Sun, 17 Nov 1996, Geoffrey D. Bennett wrote:
>
>> In case you haven't yet received an answer, I think ppmtogif is what
>> you want.
>
>Aha - thanks, I am getting somewhere I think. I have not played with this
>before, so could you check me on this please?
>
>1) perl script generates postscript and pipes this into gs...
>2) using -sDEVICE=pbm I can generate a pmb file.
>
>Now, I have looked at the pbm and ppm man pages - and I can't see how to
>get from pbm to ppm so that I can go from ppm to gif.
>
>I have a feeling that I am missing something pretty simple here - but I am
>totally stuck again!
>
>Robert Hart iweft@ipax.com.au
I am by no means an expert, but the following script has worked for me.
You invoke it as 'ps2gif myfile.ps dots-per-inch'
The '-interlace' and '-transparent white' options can be omitted.
72 dpi seems to work pretty good.
----script: ps2gif-------
#!/bin/sh
FILENAME=`basename $1 .ps`
DPI=$2
# Use ghostscript to convert postscript to ppm format
cat <<EOF | gs -dNODISPLAY pstoppm.ps
$DPI $DPI ppmsetdensity
($FILENAME) ppm8run
EOF
# Use pnmcrop to crop out the blank edges
pnmcrop ${FILENAME}.ppm > ${FILENAME}-crop.ppm;
mv ${FILENAME}-crop.ppm ${FILENAME}
# Convert ppm to gif
ppmtogif -interlace -transparent white ${FILENAME}.ppm > ${FILENAME}.gif
rm ${FILENAME}.ppm
----cut here-----
-Jon
-----------
Jon Klaren
San Diego, CA USA
jklaren@qualcomm.com
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null