Post by kenIn article <a4fbbe1c-61e4-4437-87ec-40c3a5d2f2d2
@y33g2000prg.googlegroups.com>, ***@gmail.com says...
Post by bilalhaiderI need to achieve transparency in PostScript Level 2.
In pdf
[snipped PostScript fragment]
Post by bilalhaiderWhen distilled with acrobat it gives the desired output.
How we can achieve this in PostScript Level 2.
Fundamentally, you can't. The PostScript imaging model does not support
transparency (nor does PDF prior to version 1.4).
To achieve what you want you need to calculate the intersection of the
objects, and the colour of the combined objects, and then draw all three
objects. You could also calculate the objects representing the non-
transparent portions and draw those separately, but since PostScript
only has an opaque imaging model this is not neccesary as long as you
get the Z-order correct.
For limited transparency, provided you are using CMYK colours and your
output device supports it, you can use the setoverprint operator to turn
on overprinting. When overprint is true the 0% inks do not erase the
%!PS
true setoverprint
1 0 0 0 setcmykcolor % 100% cyan
0 0 100 100 rectfill % fill rectangle
0 0 1 0 setcmykcolor % 100% yellow
50 50 100 100 rectfill % fill rectangle
showpage
Will draw yellow and cyan rectangles, the intersection of the two will
be green (cyan + yellow).
Ken
Hi ken!
Thank you very much ken for your quick responce. I run your code using
PS Alter and found that two rectangles are printing. Intersected Area
is Coverd by the Yellow rectangle and no green color is there. Y this
is happening so?
During Googling i found at Source: http://en.wikipedia.org/wiki/Transparent_pixels
"The PostScript language has limited support for full (not partial)
transparency, depending on the PostScript level.
Level 1
Level 1 PostScript offers transparency via two methods:
* A one-bit (monochrome) image can be treated as a mask. In this
case the 1-bits can be painted any single color, while the 0-bits are
not painted at all. This technique cannot be generalised to more than
one color, or to vector shapes.
* Clipping paths can be defined. These restrict what part of all
subsequent graphics can be seen. This can be used for any kind of
graphic, however in level 1, the maximum number of nodes in a path was
often limited to 1500, so complex paths (e.g. cutting around the hair
in a photograph of a person's head) often failed.
Level 2
Level 2 PostScript adds no specific transparency features. However, by
the use of patterns, arbitrary graphics can be painted through masks
defined by any vector or text operations. This is, however, complex to
implement. In addition, this too often reached implementation limits,
and few if any application programs ever offered this technique.
Level 3
Level 3 PostScript adds further transparency option for any raster
image. A transparent color, or range of colors, can be applied; or a
separate 1-bit mask can be used to provide an alpha channel."
Now as a beginner i am not getting this masking concept and how to
achieve this.