🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #5655

Generating bitmaps from Ghostscript

#5655
From: L. Peter Deutsch
Date: Mon, 13 May 1991 16:03
36 lines
1979 bytes
In message <9105130427.AA12576@wheat-chex> <1047@nlbull.bull.nl>, Jos
Vos asks how to generate bitmaps from Ghostscript.  First he tried:
	gs -DNODISPLAY
	(ps2image.ps) run
	(/tmp/mybitmap.ps) ps2image
The reason this doesn't work is that to create an image (bitmap)
device, Ghostscript needs to know the page size, resolution,
orientation, and palette.  ps2image takes these from the device that
is current at the time you invoke the ps2image procedure.  If you
start up Ghostscript with -DNODISPLAY and never select a device, the
current device is a "null device", which is not suitable.

The second try
	gs
	% here an X11 window was opened
	(ps2image.ps) run
	(/tmp/mybitmap.ps) ps2image
	(program.ps) run
should have worked, but Vos reports:
     Now, gs creates /tmp/mybitmap.ps, but the size stays zero,
     and gs hangs forever...
It may simply be that Ghostscript takes a long time to write the
image.  The code for dumping out the bitmap in this case is written
in PostScript, and is quite slow.

As an alternative, I suggest using the pstoppm utility, which writes
out PPM files instead of a PostScript `image'.  The file writing code
for this utility is written in C.

I would still like to track down the problem with ps2image, of
course.  If it is just a performance problem, I'm not averse to
adding new C operators to solve it.

L. Peter Deutsch :: Aladdin Enterprises :: P.O. box 60264, Palo Alto, CA 94306
ghost@aladdin.com ; ...decwrl!aladdin!ghost ; (415)322-0103 <<< new phone #
	    "Implementation is the sincerest form of flattery."
Technical Details
Message-ID: <89.UUL1.3#5127@aladdin.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!aladdin!ghost

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!aladdin!ghost
From: ghost@aladdin.com (L. Peter Deutsch)
Newsgroups: comp.lang.postscript
Subject: Generating bitmaps from Ghostscript
Message-ID: <89.UUL1.3#5127@aladdin.com>
Date: 13 May 91 16:03:55 GMT
Organization: Aladdin Enterprises, Menlo Park, CA
Lines: 36