[comp.lang.postscript] Color Images in PostScript

pxw@augean.ua.OZ.AU (Paul Whitbread) (04/11/91)

Firstly, apologies if this is a regular topic in this group.  I'm afraid that
I've considered the subject of this news group to be too esoteric in the past,
and have only recently felt game to write raw postscript.

I have been printing 8-bit grey level images on the Apple Laserwriter
by simply appending a header and trailer to my raw (byte) file. The
header contains suitable values to make the "image" command of p/s
print the image using the laserwriter's default half tone screens.

Recently, I have gained access to a color postscript printer -- the
Tektronics Phaser II, which, like the Apple laserwriter, is intended to
be used from Macintosh applications and comes with no details of how to
send it color postscript.

I have examined the three postscript books that I have (red green and blue)
and their mention of color is sparce. In particular they describe the
setrgbcolor and sethsbcolor commands and thats it.  I tried sending the
printer 3 band separations, preceded by the appropriate setcolor command,
and only a showpage right at the end.  This produces a monochrome output.

There is a hint in the red book that there is another way, but its followed
by a comment about "beyond the scope of this book".

There must be more information around, but I'm afraid I haven't got it at this
time.  Would some kind soul tell me how to get a color image -- preferably
from the separations -- and also what manuals/ref books I can look in to
find more on this subject?

Many Thanks,
Paul Whitbread
pxw@augean.ua.oz.au


-- 
-----------------------------------------------------------
"For every difficult and complex problem there is a simple
 and incorrect answer"
-----------------------------------------------------------

rberlin@birdlandEng.Sun.COM (Rich Berlin) (04/11/91)

In article <1031@augean.ua.OZ.AU>, pxw@augean.ua.OZ.AU (Paul Whitbread) writes:
|> Would some kind soul tell me how to get a color image -- preferably
|> from the separations -- and also what manuals/ref books I can look in to
|> find more on this subject?

There's an analogue to the image operator callec "colorimage" which
takes RGB or CMYK raster data.  You'll find it documented in the
PostScript Language Reference Manual, second edition.  You can also
get the documentation for this operator (it was an extension to the
original design) on the Adobe file server.  Try sending a mail message
to "ps-file-server@adobe.com" with the subject line 
"send Documents/Color_Ext.ps" (or, if you're running unix and have
the btoa software, you could try "send Documents/Color_Ext.ps.Zba"
instead; the smaller, compressed message will have a higher priority
with the file server so you'll likely get it sooner.)

I think you'll find it easiest to use if you reformat your data to be
interleaved either by pixel (RGBRGBRGB) or by scanline (1 line of R,
one line of G, one line of B, one line of R, etc.)

Hope that helps.

-- Rich

kevind@pogo.WV.TEK.COM (Kevin Draz) (04/16/91)

>There must be more information around, but I'm afraid I haven't got it at this
>time.  Would some kind soul tell me how to get a color image -- preferably
>from the separations -- and also what manuals/ref books I can look in to
>find more on this subject?
>
>Many Thanks,
>Paul Whitbread
>pxw@augean.ua.oz.au
>
>

Paul,

The operator(s) you are looking for can be found in several reference
documents.  One is the "Postscript Language Reference Manual, second ed."
by Adobe Systems, Inc., Pub. Addison Wesley, ISBN 0-201-18127-4, 1990.  This
book might be called the "Red book for level 2."

Another document is the "Postscript Language Color Operator Definitions"
pamphlet.  It describes the color extensions made to Level 1 for cmyk color
processing. It was available on the Adobe File Server last time I looked
(ps-file-server@adobe.com) Try sending it mail with the command "send
documents index" in the body of the message.  You could also try calling
Adobe at 415-961-0911 and asking for it.

The operators you want are "setcmykcolor" and "colorimage".  setcmykcolor
takes four real arguments on the stack in the range 0-1 inclusive,
representing percentage of that primary to apply to subsequent drawing
operations.

The "colorimage" operator can use either rgb or cmyk raster data, much like
the image operator.  It's description gets a little windy, however. I would
refer you to the above for details.

KevinD