[lug] Converting postscript images to png or gif

Ed Hill ed at eh3.com
Wed Nov 14 17:13:06 MST 2001


J. Wayde Allen wrote:

> On Tue, 13 Nov 2001, D. Stimits wrote:
> 
> 
>>plots were fairly clear.  
>>
> 
> My plots are "fairly clear", just not crisp like I'd like.  I'm beginning
> to suspect the monitor.



Could the "fuziness" be related to (1) the resolution of the images 

and/or (2) conversion to a lossy compression scheme such as jpeg?

I've converted many ps documents to various bitmap formats for inclusion
in presentations/posters/etc and have generally gotten better (that is,
crisper) output by (1) first converting to a loss-less bitmap format
such as tiff or gif and/or (2) by specifying a higher resolution than
that used by default in gs or convert.

The syntax is:

[xxx at yyy ~]$ gs --help
AFPL Ghostscript 7.00 (2001-04-08)
Copyright (C) 2001 artofcode LLC, Benicia, CA.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
  -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
  -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
  -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
  -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                          embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PDF
Available devices:
    x11 bbox x11alpha x11cmyk x11gray2 x11gray4 x11mono bmpmono bmpgray
    bmpsep1 bmpsep8 bmp16 bmp256 bmp16m bmp32b deskjet djet500 laserjet
    ljetplus ljet2p ljet3 ljet3d ljet4 ljet4d lj5mono lj5gray cdeskjet
    cdjcolor cdjmono cdj550 pj pjxl pjxl300 uniprint bj10e bj200 bjc600
    bjc800 faxg3 faxg32d faxg4 pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk
    pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm
    pksmraw tiffcrle tiffg3 tiffg32d tiffg4 tifflzw tiffpack tiff12nc
    tiff24nc psmono psgray psrgb bit bitrgb bitcmyk pngmono pnggray png16
    png256 png16m jpeg jpeggray pdfwrite pswrite epswrite pxlmono pxlcolor
    cljet5 cljet5c nullpage
Search path:
    . : /usr/local/share/ghostscript/7.00/lib :
    /usr/share/ghostscript/fonts : /usr/share/fonts/default/Type1
For more information, see /usr/local/doc/ghostscript-7.00/Use.htm.
Report bugs to bug-gs at ghostscript.com, using the form in Bug-form.htm.
[xxx at yyy ~]$

and examples of the settings are:

   gs -sDEVICE=png256 -r600x600 -sOutputFile=filename.tiff  filename.ps
   gs -sDEVICE=png256 -r300x300 -sOutputFile=filename.tiff  filename.ps
   convert filename.tiff filename.gif
   convert filename.tiff filename.jpeg

or something similar.

hth,
Ed


-- 
Edward H. Hill III, PhD
Post-Doctoral Researcher    |  Emails:   <ed at eh3.com>, <ehill at mines.edu>
Division of ESE             |  URL:      http://www.eh3.com
Colorado School of Mines    |  Phone:    303-273-3483
Golden, CO  80401           |  Fax:      303-273-3311




More information about the LUG mailing list