🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3102

Re: Help!

#3102
From: Jim Graham
Date: Fri, 14 Sep 1990 02:57
53 lines
2219 bytes
In article <265@pb2esac.UUCP>, rgrodrig@pb2esac.UUCP (Robert Rodriguez) writes:

|> The object:
|> 
|> 	To convert an X11 bitmap image (solid black logo) into
|> 	postscript, then use "setgray" (I think) to make the image lighter,
|> 	and put some text over it.
|> 
|> The method:
|> 
|> 	I've used the PBMPLUS package to convert the bitmap
|> 	into postscript without a problem.  Then I thought I'd just add
|> 	a ".5 setgray".

It probably wrapped the image bits up and used the PostScript image
operator.

|> The problem:
|> 
|> 	No matter what I do, the image is always solid black.

The image operator considers that the image data is actually a grey level
and since the color is already encoded into the image, the current color
in the graphics state gets ignored.

What you want to use is the imagemask operator which is similar to the
image operator except that the image is assumed to be a 1 bit deep
image which is used as a mask to specify where to apply the current
color.

The two forms are:

	width height bits/sample [PS matrix] {PS proc}  _image_

and

	width height invertflag [PS matrix] {PS proc}   _imagemask_

If the code generated by PBMPLUS used "1" for the bits/sample, then
you only need to do the following to get your desired results:

	1) Add a .5 setgray at the top of the file.

	2) Change the "1" (bits/sample) to a "true" (invertflag)

	3) change the "image" to an "imagemask".

If it used a bits/sample of more than "1", then you need to change
each sample in the image data to be halfway lighter.  Exactly how
to do that is too hard to explain without seeing the file (and
there are probably easier ways to achieve the results you seek).

				...jim
Technical Details
Message-ID: <1990Sep13.195701@bendenweyr.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!bendenweyr!flar
References: <265@pb2esac.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!bendenweyr!flar
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
Newsgroups: comp.lang.postscript
Subject: Re: Help!
Keywords: Image problem
Message-ID: <1990Sep13.195701@bendenweyr.Eng.Sun.COM>
Date: 14 Sep 90 02:57:01 GMT
References: <265@pb2esac.UUCP>
Sender: news@exodus.Eng.Sun.COM
Reply-To: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
Organization: Sun Microsystems, Inc.
Lines: 53