Understanding Transparency in Prepress PDF

Prepress PDFs are usually graphically rich documents that include images, vector graphics, text, smooth shades, and more; thus, the file format must be versatile and complex to accommodate all these elements. One of the more advanced features of the PDF file format is transparency, which allows overlapping objects where the background partially shows through the transparent foreground object. Transparency was introduced in PDF version 1.4 in 2001.

This blog discusses transparency in PDFs – especially with graphically rich layouts – and explains the mechanisms behind it. A future blog will give practical recommendations about dealing with transparency.

An output device that deals with transparency calculates the result color of a transparent object and its backdrop based on mathematical algorithms. These algorithms are defined in the PDF specification. However, transparency in PDF is not just one method. Three different methods and even more related internal data structures impact the result of transparent overlaps. So, this topic is rather complex…


Constant Alpha

The simplest method is constant alpha.

Alpha represents an object's opacity: an alpha value of 1.0 indicates full opacity (the object is fully visible), and a value of 0.0 indicates full transparency (the object is completely invisible). A page object with a constant alpha value of 0.5 lets the background behind it show through, but the transparent object is still visible at half strength.

Computation occurs on a per-color channel basis, resulting in a weighted average of front and backdrop color. If you have a 50% cyan object in the background and a 100% cyan object in the foreground with 0.1 constant alpha, the result color is 55%.

0.5 transparent blue circle in front of 0.5 transparent yellow triangle in front of red square


Soft Masks

As its name indicates, constant alpha uses a single, constant alpha value. In more complex cases, the alpha value is variable. In PDFs, soft masks are used to specify varying alpha values. In practice, soft masks are often applied to images, but they can also be used with any combination of graphical objects.

The soft mask itself often also is an image, but it can be any description of page objects in PDF syntax. In fact, you could turn any PDF page into a soft mask (in theory, a soft mask could also use transparency—but that would be a very weird case, so let us not go there).

When a soft mask is used in rendering, it is converted to a bitmap, where each pixel has a certain value (normally the result luminosity at that spot), which then determines the corresponding alpha value. The lighter the soft mask, the more transparent the objects rendered when the soft mask is active.

1) PDF using soft mask 2) Same PDF without soft mask 3) Just the soft mask


Separable Blend Modes

Constant alpha and soft masks calculate the weighted average of foreground and backdrop objects. But you can use more complex algorithms. Such algorithms are called blend modes.

There are two categories of blend modes. Most of them—the simpler ones—still compute each color component (e.g., Cyan) separately; they are called separable blend modes.

PDF specifies 11 separable blend modes. By far the most frequently used one is “Multiply.” This mode determines the final color by multiplying the color values of the background and foreground object, resulting in a darker color.

Blue circle using blend mode Multiply in front yellow triangle using the same blend mode in front of red square


Unseparable Blend Modes

There also are four unseparable blend modes where result color channels are calculated taking not only the corresponding input channels into account. They can be used to create artistic effects but are luckily very rare, especially in print PDFs, where they should really be avoided. To openly shame them, they are: “Hue,” “Saturation,” “Color,” and “Luminosity”. Printers could easily test their workflows for compatibility and create preflight profiles to check for their presence if necessary.

Now that we have introduced the three fundamental methods to specify transparency in PDF, we should also mention that they can be combined: An object rendered when a soft mask is active may also use the “Multiply” blend mode andconstant alpha.

Color Space Challenges

When transparently overlapping objects use different color spaces, they need to be converted into a common color space before the transparency algorithms can be applied. Suppose there, e.g., is a DeviceCMYK object transparently overlapping a DeviceRGB object. In that case, the result color needs to be specified in either of the two color spaces, and to convert them, you need to use an ICC profile. If there is no ICC profile defined in the PDF, the processor (e.g. an output device) has to use a default or working color space profile, which makes the result device dependent.

To do a predictable color conversion for transparency calculations, a PDF/X file should be created beforehand. Such a file defines source and destination color spaces (in the Output Intent ICC profile). In other words, the results of transparency calculations are always defined in PDF/X files, which is not the case in every PDF file.

And, as PDF/X-4 is the first version of PDF/X to support transparency, you should be using PDF/X-4 or newer. But we will be getting to that in another blog.

Transparency groups

Transparency groups in PDF can combine several objects so that an output device first calculates transparency within the group and then processes the entire group with its backdrop. (These groups can have additional parameters—isolated and knock-out—but we will skip that in this blog. Let me know if you want to learn more.) Such a transparency group can also define an ICC-based “group color space” that must be used for transparency calculations within the group.

Back to overview
 

Subscribe to our blog newsletter for access to regular updates

No strings attached. Unsubscribe anytime. For further details, review our Privacy Policy.