Skip to content

PDF Spec 11 Specifying

Marc Jones edited this page Dec 30, 2025 · 1 revision

11.7 Specifying Transparency

Part of: PDF-Spec-11-Transparency

Navigation: PDF-Spec-11-Soft-Masks | PDF-Spec-Index | Next →


The second way to define a soft mask is by associating a soft-mask image with an image XObject. This is a subsidiary image XObject specified in the SMask entry of the parent XObject's image dictionary (see 'Image Dictionaries'). Entries in the subsidiary image dictionary for such a soft-mask image shall have the same format and meaning as in that of an ordinary image XObject (as described in Table 89 in 'Image Dictionaries'), subject to the restrictions listed in Table 145. This type of image dictionary may contain an additional entry, Matte .

When an image is accompanied by a soft-mask image, it is sometimes advantageous for the image data to be preblended with some background colour, called the matte colour . Each image sample represents a weighted average of the original source colour and the matte colour, using the corresponding mask sample as the weighting factor. (This is a generalization of a technique commonly called premultiplied alpha .)

If the image data is preblended, the matte colour shall be specified by a Matte entry in the soft-mask image dictionary (see Table 145). The preblending computation, performed independently for each component, shall be

where c ′ is the value to be provided in the image source data

c is the original image component value m is the matte colour component value

α is the corresponding mask sample

This computation shall use actual colour component values, with the effects of the Filter and Decode transformations already performed. The computation shall be the same whether the colour space is additive or subtractive.

Table 145 - Restrictions on the entries in a soft-mask image dictionary

Key Restriction
Type If present, shall be XObject .
Subtype Shall be Image .
Width If a Matte entry (see Table 146) is present, shall be the same as the Width value of the parent image; otherwise independent of it. Both images shall be mapped to the unit square in user space (as are all images), regardless of whether the samples coincide individually.
Height Same considerations as for Width .
ColorSpace Required; shall be DeviceGray .
BitsPerComponent Required.
Intent Ignored.
ImageMask Shall be false or absent.
Mask Shall be absent.
SMask Shall be absent.
Decode Default value: [0 1].
Interpolate Optional.
Alternates Ignored.
Name Ignored.
StructParent Ignored.
ID Ignored.
OPI Ignored.

Table 146 - Additional entry in a soft-mask image dictionary

Key Type Value
Matte array (Optional; PDF 1.4) An array of component values specifying the matte colour with which the image data in the parent image shall have been preblended. The array shall consist of n numbers, where n is the number of components in the colour space specified by the ColorSpace entry in the parent image's image dictionary; the numbers shall be valid colour components in that colour space. If this entry is absent, the image data shall not be preblended.

When preblended image data is used in transparency blending and compositing computations, the results shall be the same as if the original, unblended image data were used and no matte colour were specified. In particular, the inputs to the blend function shall be the original colour values. To derive c from c ′ , the conforming reader may sometimes need to invert the formula shown previously. The resulting c value shall lie within the range of colour component values for the image colour space.

The preblending computation shall be done in the colour space specified by the parent image's ColorSpace entry. This is independent of the group colour space into which the image may be painted. If a colour conversion is required, inversion of the preblending shall precede the colour conversion. If the image colour space is an Indexed space (see 'Indexed Colour Spaces'), the colour values in the colour table (not the index values themselves) shall be preblended.

11.6.6 Transparency Group XObjects

A transparency group is represented in PDF as a special type of group XObject (see 'Group XObjects') called a transparency group XObject . A group XObject is in turn a type of form XObject, distinguished by the presence of a Group entry in its form dictionary (see 'Form Dictionaries'). The value of this entry is a subsidiary group attributes dictionary defining the properties of the group. The format and meaning of the dictionary's contents shall be determined by its group subtype , which is specified by the dictionary's S entry. The entries for a transparency group (subtype Transparency ) are shown in Table 147.

A page object (see 'Page Objects') may also have a Group entry, whose value is a group attributes dictionary specifying the attributes of the page group (see 'Page Group'). Some of the dictionary entries are interpreted slightly differently for a page group than for a transparency group XObject; see their descriptions in the table for details.

Table 147 - Additional entries specific to a transparency group attributes dictionary

Key Type Value
S name (Required) The group subtype , which identifies the type of group whose attributes this dictionary describes; shall be Transparency for a transparency group.

Table 147 - Additional entries specific to a transparency group attributes dictionary (continued)

Key Type Value
CS name or array (Sometimes required) The group colour space, which is used for the following purposes: • As the colour space into which colours shall be converted when painted into the group • As the blending colour space in which objects shall be composited within the group (see 'Blending Colour Space') • As the colour space of the group as a whole when it in turn is painted as an object onto its backdrop The group colour space shall be any device or CIE-based colour space that treats its components as independent additive or subtractive values in the range 0.0 to 1.0, subject to the restrictions described in 11.3.4, "Blending Colour Space." These restrictions exclude Lab and lightness- chromaticity ICCBased colour spaces, as well as the special colour spaces Pattern , Indexed , Separation , and DeviceN . Device colour spaces shall be subject to remapping according to the DefaultGray , DefaultRGB , and DefaultCMYK entries in the ColorSpace subdictionary of the current resource dictionary (see 'Default Colour Spaces'). Ordinarily, the CS entry may be present only for isolated transparency groups (those for which I is true ), and even then it is optional. However, this entry shall be present in the group attributes dictionary for any transparency group XObject that has no parent group or page from which to inherit-in particular, one that is the value of the G entry in a soft-mask dictionary of subtype Luminosity (see 'Soft-Mask Dictionaries'). Additionally, the CS entry may be present in the group attributes dictionary associated with a page object, even if I is false or absent. In the normal case in which the page is imposed directly on the output medium, the page group is effectively isolated regardless of the I value, and the specified CS value shall therefore be honoured. But if the page is in turn used as an element of some other page and if the group is non- isolated, CS shall be ignored and the colour space shall be inherited from the actual backdrop with which the page is composited (see 'Page Group'). Default value: the colour space of the parent group or page into which this transparency group is painted. (The parent's colour space in turn may be either explicitly specified or inherited.) For a transparency group XObject used as an annotation appearance
I boolean (Optional) A flag specifying whether the transparency group is isolated (see 'Isolated Groups'). If this flag is true , objects within the group shall be composited against a fully transparent initial backdrop; if false , they shall be composited against the group's backdrop. Default value: false . In the group attributes dictionary for a page, the interpretation of this entry shall be slightly altered. In the normal case in which the page is imposed directly on the output medium, the page group is effectively isolated and the specified I value shall be ignored. But if the page is in turn used as an element of some other page, it shall be treated as if it were a transparency group XObject; the I value shall be interpreted in the normal way to determine whether the page group is isolated.

Table 147 - Additional entries specific to a transparency group attributes dictionary (continued)

Key Type Value
K boolean (Optional) A flag specifying whether the transparency group is a knockout group (see 'Knockout Groups'). If this flag is false , later objects within the group shall be composited with earlier ones with which they overlap; if true , they shall be composited with the group's initial backdrop and shall overwrite ('knock out') any earlier overlapping objects. Default value: false .

The transparency group XObject's content stream shall define the graphics objects belonging to the group. When applied to a transparency group XObject, the Do operator shall execute its content stream and shall composite the resulting group colour, shape, and opacity into the group's parent group or page as if they had come from an elementary graphics object. Do shall perform the following actions in addition to the normal ones for a form XObject (as described in 'Form XObjects'):

  • If the transparency group is non-isolated (the value of the I entry in its group attributes dictionary is false ) , its initial backdrop, within the bounding box specified by the XObject's BBox entry, shall be defined to be the accumulated colour and alpha of the parent group or page-that is, the result of everything that has been painted in the parent up to that point. However, if the parent is a knockout group, the initial backdrop shall be the same as that of the parent. If the group is isolated ( I is true ), its initial backdrop shall be defined to be transparent.
  • Before execution of the transparency group XObject's content stream, the current blend mode in the graphics state shall be initialized to Normal , the current stroking and nonstroking alpha constants to 1.0, and the current soft mask to None .

NOTE 1 The purpose of initializing these graphics state parameters at the beginning of execution is to ensure that they are not applied twice: once when member objects are painted into the group and again when the group is painted into the parent group or page.

  • Objects painted by operators in the transparency group XObject's content stream shall be composited into the group according to the rules described in 11.3.3, "Basic Compositing Formula." The knockout flag ( K ) in the group attributes dictionary and the transparency-related parameters of the graphics state shall be honoured during this computation.
  • If a group colour space ( CS ) is specified in the group attributes dictionary, all painting operators shall convert source colours to that colour space before compositing objects into the group, and the resulting colour at each point shall be interpreted in that colour space. If no group colour space is specified, the prevailing colour space shall be dynamically inherited from the parent group or page. (If not otherwise specified, the page group's colour space shall be inherited from the native colour space of the output device.)
  • After execution of the transparency group XObject's content stream, the graphics state shall revert to its former state before the invocation of the Do operator (as it does for any form XObject). The group's shape-the union of all objects painted into the group, clipped by the group XObject's bounding boxshall then be painted into the parent group or page, using the group's accumulated colour and opacity at each point.

If the Do operator is invoked more than once for a given transparency group XObject, each invocation shall be treated as a separate transparency group. That is, the result shall be as if the group were independently composited with the backdrop on each invocation.

NOTE 2 Applications that perform caching of rendered form XObjects shall take this requirement into account.

The actions described previously shall occur only for a transparency group XObject-a form XObject having a Group entry that designates a group attributes subdictionary whose group subtype ( S ) is Transparency . An ordinary form XObject-one having no Group entry-shall not be subject to any grouping behaviour for

transparency purposes. That is, the graphics objects it contains shall be composited individually, just as if they were painted directly into the parent group or page.

11.6.7 Patterns and Transparency

In the transparent imaging model, the graphics objects making up the pattern cell of a tiling pattern (see 'Tiling Patterns') may include transparent objects and transparency groups. Transparent compositing may occur both within the pattern cell and between it and the backdrop wherever the pattern is painted. Similarly, a shading pattern ('Shading Patterns') composites with its backdrop as if the shading dictionary were applied with the sh operator.

In both cases, the pattern definition shall be treated as if it were implicitly enclosed in a non-isolated transparency group: a non-knockout group for tiling patterns, a knockout group for shading patterns. The definition shall not inherit the current values of the graphics state parameters at the time it is evaluated; those parameters shall take effect only when the resulting pattern is later used to paint an object. Instead, the graphics state parameters shall be initialized as follows:

  • As always for transparency groups, those parameters related to transparency (blend mode, soft mask, and alpha constant) shall be initialized to their standard default values.
  • All other parameters shall be initialized to their values at the beginning of the content stream (such as a page or a form XObject) in which the pattern shall be defined as a resource. (This is the normal behaviour for all patterns, in both the opaque and transparent imaging models.)
  • In the case of a shading pattern, the parameter values may be augmented by the contents of the ExtGState entry in the pattern dictionary (see 'Shading Patterns'). Only those parameters that affect the sh operator, such as the current transformation matrix and rendering intent, shall be used. Parameters that affect path-painting operators shall not be used, since the execution of sh does not entail painting a path.
  • If the shading dictionary has a Background entry, the pattern's implicit transparency group shall be filled with the specified background colour before the sh operator is invoked.

When the pattern is later used to paint a graphics object, the colour, shape, and opacity values resulting from the evaluation of the pattern definition shall be used as the object's source colour (C s ) , object shape (f j ) , and object opacity (q j ) in the transparency compositing formulas. This painting operation is subject to the values of the graphics state parameters in effect at the time, just as in painting an object with a constant colour.

  • NOTE 1 Unlike the opaque imaging model, in which the pattern cell of a tiling pattern may be evaluated once and then replicated indefinitely to fill the painted area, the effect in the general transparent case is as if the pattern definition were reexecuted independently for each tile, taking into account the colour of the backdrop at each point. However, in the common case in which the pattern consists entirely of objects painted with the Normal blend mode, this behaviour can be optimized by treating the pattern cell as if it were an isolated group. Since in this case the results depend only on the colour, shape, and opacity of the pattern cell and not on those of the backdrop, the pattern cell can be evaluated once and then replicated, just as in opaque painting.
  • NOTE 2 In a raster-based implementation of tiling, all tiles should be treated as a single transparency group. This avoids artifacts due to multiple marking of pixels along the boundaries between adjacent tiles.

The foregoing discussion applies to both coloured ( PaintType 1) and uncoloured ( PaintType 2) tiling patterns. In the latter case, the restriction that an uncoloured pattern's definition shall not specify colours extends as well to any transparency group that the definition may include. There are no corresponding restrictions, however, on specifying transparency-related parameters in the graphics state.

11.7 Colour Space and Rendering Issues

11.7.1 General

This sub-clause describes the interactions between transparency and other aspects of colour specification and rendering in the PDF imaging model.

11.7.2 Colour Spaces for Transparency Groups

As discussed in 11.6.6, "Transparency Group XObjects," a transparency group shall either have an explicitly declared colour space of its own or inherit that of its parent group. In either case, the colours of source objects within the group shall be converted to the group's colour space, if necessary, and all blending and compositing computations shall be done in that space (see 'Blending Colour Space'). The resulting colours shall then be interpreted in that colour space when the group is subsequently composited with its backdrop.

  • NOTE 1 Under this arrangement, it is envisioned that all or most of a given piece of artwork will be created in a single colour space-most likely, the working colour space of the application generating it. The use of multiple colour spaces typically will arise only when assembling independently produced artwork onto a page. After all the artwork has been placed on the page, the conversion from the group's colour space to the page's device colour space will be done as the last step, without any further transparency compositing. The transparent imaging model does not require that this convention be followed, however; the reason for adopting it is to avoid the loss of colour information and the introduction of errors resulting from unnecessary colour space conversions.

Only an isolated group may have an explicitly declared colour space of its own. Non-isolated groups shall inherit their colour space from the parent group (subject to special treatment for the page group, as described in 'Page Group').

  • NOTE 2 This is because the use of an explicit colour space in a non-isolated group would require converting colours from the backdrop's colour space to that of the group in order to perform the compositing computations. Such conversion may not be possible (since some colour conversions can be performed only in one direction), and even if possible, it would entail an excessive number of colour conversions.
  • NOTE 3 The choice of a group colour space has significant effects on the results that are produced:

As noted in 11.3.4, "Blending Colour Space," the results of compositing in a device colour space is devicedependent. For the compositing computations to work in a device-independent way, the group's colour space should be CIE-based.

A consequence of choosing a CIE-based group colour space is that only CIE-based spaces can be used to specify the colours of objects within the group. This is because conversion from device to CIE-based colours is not possible in general; the defined conversions work only in the opposite direction. See further discussion subsequently.

The compositing computations and blend functions generally compute linear combinations of colour component values, on the assumption that the component values themselves are linear. For this reason, it is usually best to choose a group colour space that has a linear gamma function. If a nonlinear colour space is chosen, the results are still well-defined, but the appearance may not match the user's expectations.

  • NOTE 4 The CIE-based sRGB colour space (see 'CIE-Based Colour Spaces') is nonlinear and hence may be unsuitable for use as a group colour space.
  • NOTE 5 Implementations of the transparent imaging model should use as much precision as possible in representing colours during compositing computations and in the accumulated group results. To minimize the accumulation of roundoff errors and avoid additional errors arising from the use of linear group colour spaces, more precision is needed for intermediate results than is typically used to represent either the original source data or the final rasterized results.

If a group's colour space-whether specified explicitly or inherited from the parent group-is CIE-based, any use of device colour spaces for painting objects shall be subject to special treatment. Device colours cannot be painted directly into such a group, since there is no generally defined method for converting them to the CIEbased colour space. This problem arises in the following cases:

  • DeviceGray , DeviceRGB , and DeviceCMYK colour spaces, unless remapped to default CIE-based colour spaces (see 'Default Colour Spaces')
  • Operators (such as rg ) that specify a device colour space implicitly, unless that space is remapped
  • Special colour spaces whose base or underlying space is a device colour space, unless that space is remapped

The default colour space remapping mechanism should always be employed when defining a transparency group whose colour space is CIE-based. If a device colour is specified and is not remapped, it shall be converted to the CIE-based colour space in an implementation-dependent fashion, producing unpredictable results.

  • NOTE 6 The foregoing restrictions do not apply if the group's colour space is implicitly converted to DeviceCMYK , as discussed in 'Implicit Conversion of CIE-Based Colour Spaces'.

11.7.3 Spot Colours and Transparency

The foregoing discussion of colour spaces has been concerned with process colours -those produced by combinations of an output device's process colorants. Process colours may be specified directly in the device's native colour space (such as DeviceCMYK ), or they may be produced by conversion from some other colour space, such as a CIE-based ( CalRGB or ICCBased ) space. Whatever means is used to specify them, process colours shall be subject to conversion to and from the group's colour space.

A spot colour is an additional colour component, independent of those used to produce process colours. It may represent either an additional separation to be produced or an additional colorant to be applied to the composite page (see 'Separation Colour Spaces' and 'DeviceN Colour Spaces'). The colour component value, or tint , for a spot colour specifies the concentration of the corresponding spot colorant. Tints are conventionally represented as subtractive, rather than additive, values.

Spot colours are inherently device-dependent and are not always available. In the opaque imaging model, each use of a spot colour component in a Separation or DeviceN colour space is accompanied by an alternate colour space and a tint transformation function for mapping tint values into that space. This enables the colour to be approximated with process colorants when the corresponding spot colorant is not available on the device.

Spot colours can be accommodated straightforwardly in the transparent imaging model (except for issues relating to overprinting, discussed in 'Overprinting and Transparency'). When an object is painted transparently with a spot colour component that is available in the output device, that colour shall be composited with the corresponding spot colour component of the backdrop, independently of the compositing that is performed for process colours. A spot colour retains its own identity; it shall not be subject to conversion to or from the colour space of the enclosing transparency group or page. If the object is an element of a transparency group, one of two things shall happen:

  • The group shall maintain a separate colour value for each spot colour component, independently of the group's colour space. In effect, the spot colour passes directly through the group hierarchy to the device, with no colour conversions performed. However, it shall still be subject to blending and compositing with other objects that use the same spot colour.
  • The spot colour shall be converted to its alternate colour space. The resulting colour shall then be subject to the usual compositing rules for process colours. In particular, spot colours shall not be available in a transparency group XObject that is used to define a soft mask; the alternate colour space shall always be substituted in that case.

Only a single shape value and opacity value shall be maintained at each point in the computed group results; they shall apply to both process and spot colour components. In effect, every object shall be considered to paint every existing colour component, both process and spot. Where no value has been explicitly specified for a given component in a given object, an additive value of 1.0 (or a subtractive tint value of 0.0) shall be assumed. For instance, when painting an object with a colour specified in a DeviceCMYK or ICCBased colour space, the process colour components shall be painted as specified and the spot colour components shall be

painted with an additive value of 1.0. Likewise, when painting an object with a colour specified in a Separation colour space, the named spot colour shall be painted as specified and all other components (both process colours and other spot colours) shall be painted with an additive value of 1.0. The consequences of this are discussed in 11.7.4, "Overprinting and Transparency."

Under the opaque imaging model, a Separation or DeviceN colour space may specify the individual process colour components of the output device, as if they were spot colours. However, within a transparency group, this should be done only if the group inherits the native colour space of the output device (or is implicitly converted to DeviceCMYK , as discussed in 8.6.5.7, "Implicit Conversion of CIE-Based Colour Spaces"). If any other colour space has been specified for the group, the Separation or DeviceN colour space shall be converted to its alternate colour space.

  • NOTE In general, within a transparency group containing an explicitly-specified colour space, the group's process colour components are different from the device's process colour components. Conversion to the device's process colour components occurs only after all colour compositing computations for the group have been completed. Consequently, the device's process colour components are not accessible within the group.

For instance, outside of any transparency group, a device whose native colour space is DeviceCMYK has a Cyan component that may be specified in a Separation or DeviceN colour space. On the other hand, within a transparency group whose colour space is ICCBased , the group has no Cyan component available to be painted.

11.7.4 Overprinting and Transparency

11.7.4.1 General

In the opaque imaging model, overprinting is controlled by two parameters of the graphics state: the overprint parameter and the overprint mode (see 'Overprint Control'). Painting an object causes some specific set of device colorants to be marked, as determined by the current colour space and current colour in the graphics state. The remaining colorants shall be either erased or left unchanged, depending on whether the overprint parameter is false or true . When the current colour space is DeviceCMYK , the overprint mode parameter additionally enables this selective marking of colorants to be applied to individual colour components according to whether the component value is zero or nonzero.

  • NOTE 1 Because this model of overprinting deals directly with the painting of device colorants, independently of the colour space in which source colours have been specified, it is highly device-dependent and primarily addresses production needs rather than design intent. Overprinting is usually reserved for opaque colorants or for very dark colours, such as black. It is also invoked during late-stage production operations such as trapping (see 'Trapping Support'), when the actual set of device colorants has already been determined.
  • NOTE 2 Consequently, it is best to think of transparency as taking place in appearance space, but overprinting of device colorants in device space. This means that colorant overprint decisions should be made at output time, based on the actual resultant colorants of any transparency compositing operation. On the other hand, effects similar to overprinting can be achieved in a device-independent manner by taking advantage of blend modes, as described in the next sub-clause.

11.7.4.2 Blend Modes and Overprinting

As stated in 11.7.3, "Spot Colours and Transparency," each graphics object that is painted shall affect all existing colour components: all process colorants in the transparency group's colour space as well as any available spot colorants. For colour components whose value has not been specified, a source colour value of 1.0 shall be assumed; when objects are fully opaque and the Normal blend mode is used, this shall have the effect of erasing those components. This treatment is consistent with the behaviour of the opaque imaging model with the overprint parameter set to false .

The transparent imaging model defines some blend modes, such as Darken , that can be used to achieve effects similar to overprinting. The blend function for Darken is

In this blend mode, the result of compositing shall always be the same as the backdrop colour when the source colour is 1.0, as it is for all unspecified colour components. When the backdrop is fully opaque, this shall leave the result colour unchanged from that of the backdrop. This is consistent with the behaviour of the opaque imaging model with the overprint parameter set to true .

If the object or backdrop is not fully opaque, the actions described previously are altered accordingly. That is, the erasing effect shall be reduced, and overprinting an object with a colour value of 1.0 may affect the result colour. While these results may or may not be useful, they lie outside the realm of the overprinting and erasing behaviour defined in the opaque imaging model.

When process colours are overprinted or erased (because a spot colour is being painted), the blending computations described previously shall be done independently for each component in the group's colour space. If that space is different from the native colour space of the output device, its components are not the device's actual process colorants; the blending computations shall affect the process colorants only after the group's results have been converted to the device colour space. Thus the effect is different from that of overprinting or erasing the device's process colorants directly. On the other hand, this is a fully general operation that works uniformly, regardless of the type of object or of the computations that produced the source colour.

  • NOTE 1 The discussion so far has focused on those colour components whose values are not specified and that are to be either erased or left unchanged. However, the Normal or Darken blend modes used for these purposes may not be suitable for use on those components whose colour values are specified. In particular, using the Darken blend mode for such components would preclude overprinting a dark colour with a lighter one. Moreover, some other blend mode may be specifically desired for those components.

The PDF graphics state specifies only one current blend mode parameter, which shall always apply to process colorants and sometimes to spot colorants as well. Specifically, only separable, white-preserving blend modes shall be used for spot colours. If the specified blend mode is not separable and white-preserving, it shall apply only to process colour components, and the Normal blend mode shall be substituted for spot colours.

A blend mode is white-preserving if its blend function B has the property that B (1.0, 1.0) = 1.0.

  • NOTE 2 Of the standard separable blend modes listed in Table 136 in 11.3.5, "Blend Mode," all except Difference and Exclusion are white-preserving. This ensures that when objects accumulate in an isolated transparency group, the accumulated values for unspecified components remain 1.0 as long as only white-preserving blend modes are used. The group's results can then be overprinted using Darken (or other useful modes) while avoiding unwanted interactions with components whose values were never specified within the group.

11.7.4.3 Compatibility with Opaque Overprinting

Because the use of blend modes to achieve effects similar to overprinting does not make direct use of the overprint control parameters in the graphics state, such methods are usable only by transparency-aware applications. For compatibility with the methods of overprint control used in the opaque imaging model, a special blend mode, CompatibleOverprint, is provided that consults the overprint-related graphics state parameters to compute its result. This mode shall apply only when painting elementary graphics objects (fills, strokes, text, images, and shadings). It shall not be invoked explicitly and shall not be identified by any PDF name object; rather, it shall be implicitly invoked whenever an elementary graphics object is painted while overprinting is enabled (that is, when the overprint parameter in the graphics state is true ).

  • NOTE 1 Earlier designs of the transparent imaging model included an additional blend mode named Compatible , which explicitly invoked the CompatibleOverprint blend mode described here. Because CompatibleOverprint is now invoked implicitly whenever appropriate, it is never necessary to specify the Compatible blend mode for use in compositing.

The Compatible blend mode shall be treated as equivalent to Normal .

The value of the blend function B ( c b , c s ) in the CompatibleOverprint mode shall be either c b or c s , depending on the setting of the overprint mode parameter, the current and group colour spaces, and the source colour value c s :

  • If the overprint mode is 1 (nonzero overprint mode) and the current colour space and group colour space are both DeviceCMYK , then process colour components with nonzero values shall replace the corresponding component values of the backdrop; components with zero values leave the existing backdrop value unchanged. That is, the value of the blend function B ( c b , c s ) shall be the source component c s for any process ( DeviceCMYK ) colour component whose (subtractive) colour value is nonzero; otherwise it shall be the backdrop component c b . For spot colour components, the value shall always be c b .
  • In all other cases, the value of B ( c b , c s ) shall be c s for all colour components specified in the current colour space, otherwise c b .
  • EXAMPLE 1 If the current colour space is DeviceCMYK or CalRGB , the value of the blend function is c s for process colour components and c b for spot components. On the other hand, if the current colour space is a Separation space representing a spot colour component, the value is c s for that spot component and c b for all process components and all other spot components.
  • NOTE 2 In the previous descriptions, the term current colour space refers to the colour space used for a painting operation. This may be specified by the current colour space parameter in the graphics state (see 'Colour Values'), implicitly by colour operators such as rg ('Colour Operators'), or by the ColorSpace entry of an image XObject ('Image Dictionaries'). In the case of an Indexed space, it refers to the base colour space (see 'Indexed Colour Spaces'); likewise for Separation and DeviceN spaces that revert to their alternate colour space, as described under 'Separation Colour Spaces' and 'DeviceN Colour Spaces'.

If the current blend mode when CompatibleOverprint is invoked is any mode other than Normal , the object being painted shall be implicitly treated as if it were defined in a non-isolated, non-knockout transparency group and painted using the CompatibleOverprint blend mode. The group's results shall then be painted using the current blend mode in the graphics state.

  • NOTE 3 It is not necessary to create such an implicit transparency group if the current blend mode is Normal ; simply substituting the CompatibleOverprint blend mode while painting the object produces equivalent results. There are some additional cases in which the implicit transparency group can be optimized out.
  • EXAMPLE 2 Figure L.20 in Annex L shows the effects of all four possible combinations of blending and overprinting, using the Screen blend mode in the DeviceCMYK colour space. The label 'overprint enabled' means that the overprint parameter in the graphics state is true and the overprint mode is 1. In the upper half of the figure, a light green oval is painted opaquely (opacity = 1.0) over a backdrop shading from pure yellow to pure magenta. In the lower half, the same object is painted with transparency (opacity = 0.5).

11.7.4.4 Special Path-Painting Considerations

The overprinting considerations discussed in 11.7.4.3, "Compatibility with Opaque Overprinting," also affect those path-painting operations that combine filling and stroking a path in a single operation. These include the B , B* , b , and b* operators (see 'Path-Painting Operators') and the painting of glyphs with text rendering mode 2 or 6 ('Text Rendering Mode'). For transparency compositing purposes, the combined fill and stroke shall be treated as a single graphics object, as if they were enclosed in a transparency group. This implicit group is established and used as follows:

  • If overprinting is enabled (the overprint parameter in the graphics state is true ) and the current stroking and nonstroking alpha constants are equal, a non-isolated, non-knockout transparency group shall be established. Within the group, the fill and stroke shall be performed with an alpha value of 1.0 but with the CompatibleOverprint blend mode. The group results shall then be composited with the backdrop, using the originally specified alpha and blend mode.

  • In all other cases, a non-isolated knockout group shall be established. Within the group, the fill and stroke shall be performed with their respective prevailing alpha constants and the prevailing blend mode. The group results shall then be composited with the backdrop, using an alpha value of 1.0 and the Normal blend mode.

  • NOTE 1 In the case of showing text with the combined filling and stroking text rendering modes, this behaviour is independent of the text knockout parameter in the graphics state (see 'Text Knockout').

  • NOTE 2 The purpose of these rules is to avoid having a non-opaque stroke composite with the result of the fill in the region of overlap, which would produce a double border effect that is usually undesirable. The special case that applies when the overprint parameter is true is for backward compatibility with the overprinting behavior of the opaque imaging model. If a desired effect cannot be achieved with a combined filling and stroking operator or text rendering mode, it can be achieved by specifying the fill and stroke with separate path objects and an explicit transparency group.

  • NOTE 3 Overprinting of the stroke over the fill does not work in the second case described previously (although either the fill or the stroke can still overprint the backdrop). Furthermore, if the overprint graphics state parameter is true , the results are discontinuous at the transition between equal and unequal values of the stroking and nonstroking alpha constants. For this reason, it is best not to use overprinting for combined filling and stroking operations if the stroking and nonstroking alpha constants are being varied independently.

11.7.4.5 Summary of Overprinting Behaviour

Tables 148 and 149 summarize the overprinting and erasing behaviour in the opaque and transparent imaging models, respectively. Table 148 shows the overprinting rules used in the opaque model, as described in 'Overprint Control'. Table 149 shows the equivalent rules as implemented by the CompatibleOverprint blend mode in the transparent model. The names OP and OPM in the tables refer to the overprint and overprint mode parameters of the graphics state.

Table 148 - Overprinting behavior in the opaque imaging model

Source colour space Affected colour Effect on colour component Effect on colour component Effect on colour component
Source colour space component OP false OP true, OPM 0 OP true, OPM 1
DeviceCMYK , specified directly, not in a sampled image C , M , Y , or K Paint source Paint source Paint source if ≠ 0.0 Do not paint if = 0.0
DeviceCMYK , specified directly, not in a sampled image Process colorant other than CMYK Paint source Paint source Paint source
DeviceCMYK , specified directly, not in a sampled image Spot colorant Paint 0.0 Do not paint Do not paint
Any process colour space (including other cases of DeviceCMYK ) Process colorant Paint source Paint source Paint source
Any process colour space (including other cases of DeviceCMYK ) Spot colorant Paint 0.0 Do not paint Do not paint
Separation or DeviceN Process colorant Paint 0.0 Do not paint Do not paint
Separation or DeviceN Spot colorant named in source space Paint source Paint source Paint source
Separation or DeviceN Spot colorant not named in source space Paint 0.0 Do not paint Do not paint

Table 149 - Overprinting behavior in the transparent imaging model

Source color space Affected colour component of group colour space Value of blend function B ( c b , c s ) expressed as tint Value of blend function B ( c b , c s ) expressed as tint Value of blend function B ( c b , c s ) expressed as tint
Source color space Affected colour component of group colour space OP false OP true, OPM 0 OP true, OPM 1
DeviceCMYK , specified directly, not in a sampled image C , M , Y , or K c s c s c s if c s ≠ 0.0 c b if c s = 0.0
DeviceCMYK , specified directly, not in a sampled image Process colour component other than CMYK c s c s c s
DeviceCMYK , specified directly, not in a sampled image Spot colorant c s ( = 0.0) c b c b
Any process colour space (including other cases of DeviceCMYK ) Process colour component c s c s c s
Any process colour space (including other cases of DeviceCMYK ) Spot colorant c s ( = 0.0) c b c b
Separation or DeviceN Process colour component c s ( = 0.0) c b c b
Separation or DeviceN Spot colorant named in source space c s c s c s
Separation or DeviceN Spot colorant not named in source space c s ( = 0.0) c b c b
A group (not an elementary object) All colour components c s c s c s

Colour component values are represented in these tables as subtractive tint values because overprinting is typically applied to subtractive colorants such as inks rather than to additive ones such as phosphors on a display screen. The CompatibleOverprint blend mode is therefore described as if it took subtractive arguments and returned subtractive results. In reality, however, CompatibleOverprint (like all blend modes) shall treat colour components as additive values; subtractive components shall be complemented before and after application of the blend function.

  • NOTE 1 This note describes an important difference between Table 148 and Table 149. In Table 148, the process colour components being discussed are the actual device colorants-the colour components of the output device's native colour space ( DeviceGray , DeviceRGB , or DeviceCMYK ). In Table 149, the process colour components are those of the group's colour space, which is not necessarily the same as that of the output device (and can even be something like CalRGB or ICCBased ). For this reason, the process colour components of the group colour space cannot be treated as if they were spot colours in a Separation or DeviceN colour space (see 'Spot Colours and Transparency'). This difference between opaque and transparent overprinting and erasing rules arises only within a transparency group (including the page group, if its colour space is different from the native colour space of the output device). There is no difference in the treatment of spot colour components.
  • NOTE 2 Table 149 has one additional row at the bottom. It applies when painting an object that is a transparency group rather than an elementary object (fill, stroke, text, image, or shading). As stated in 11.7.3, "Spot Colours and Transparency," a group is considered to paint all colour components, both process and spot. Colour components that were not explicitly painted by any object in the group have an additive colour value of 1.0 (subtractive tint 0.0). Since no information is retained about which components were actually painted within the group, compatible overprinting is not possible in this case; the CompatibleOverprint blend mode reverts to Normal , with no consideration of the overprint and overprint mode parameters. A transparency-aware conforming writer can choose a more suitable blend mode, such as Darken , to produce an effect similar to overprinting.

11.7.5 Rendering Parameters and Transparency

11.7.5.1 General

The opaque imaging model has several graphics state parameters dealing with the rendering of colour: the current halftone (see 'Halftone Dictionaries'), transfer functions ('Transfer Functions'), rendering intent ('Rendering Intents'), and black-generation and undercolor-removal functions ('Conversion from DeviceRGB to DeviceCMYK'). All of these rendering parameters may be specified on a per-object basis; they control how a particular object is rendered. When all objects are opaque, it is easy to define what this means. But when they are transparent, more than one object may contribute to the colour at a given point; it is unclear which rendering parameters to apply in an area where transparent objects overlap. At the same time, the transparent imaging model should be consistent with the opaque model when only opaque objects are painted.

There are two categories of rendering parameters that are treated somewhat differently in the presence of transparency. In the first category are halftone and transfer functions, which are applied only when the final colour at a given point on the page is known. In the second category are rendering intent, black generation, and undercolor removal, which are applied whenever colours are converted from one colour space to another.

11.7.5.2 Halftone and Transfer Function

When objects are transparent, rendering of an object does not occur when the object is specified but at some later time. Hence, the implementation shall keep track of the halftone and transfer function parameters at each point on the page from the time they are specified until the time rendering actually occurs. This means that these rendering parameters shall be associated with regions of the page rather than with individual objects.

The halftone and transfer function to be used at any given point on the page shall be those in effect at the time of painting the last (topmost) elementary graphics object enclosing that point, but only if the object is fully opaque. Only elementary objects shall be relevant; the rendering parameters associated with a group object are ignored. The topmost object at any point shall be defined to be the topmost elementary object in the entire page stack that has a nonzero object shape value (f j ) at that point (that is, for which the point is inside the object). An object shall be considered to be fully opaque if all of the following conditions hold at the time the object is painted:

  • The current alpha constant in the graphics state (stroking or nonstroking, depending on the painting operation) is 1.0.
  • The current blend mode in the graphics state is Normal (or Compatible , which is treated as equivalent to Normal ).
  • The current soft mask in the graphics state is None . If the object is an image XObject, there is not an SMask entry in its image dictionary.
  • The foregoing three conditions were also true at the time the Do operator was invoked for the group containing the object, as well as for any direct ancestor groups.
  • If the current colour is a tiling pattern, all objects in the definition of its pattern cell also satisfy the foregoing conditions.

Together, these conditions ensure that only the object itself shall contribute to the colour at the given point, completely obscuring the backdrop. For portions of the page whose topmost object is not fully opaque or that are never painted at all, the default halftone and transfer function for the page shall be used.

If a graphics object is painted with overprinting enabled-that is, if the applicable (stroking or nonstroking) overprint parameter in the graphics state is true -the halftone and transfer function to use at a given point shall be determined independently for each colour component. Overprinting implicitly invokes the CompatibleOverprint blend mode (see 'Compatibility with Opaque Overprinting'). An object shall be considered opaque for a given component only if CompatibleOverprint yields the source colour (not the backdrop colour) for that component.

11.7.5.3 Rendering Intent and Colour Conversions

The rendering intent, black-generation, and undercolor-removal parameters control certain colour conversions. In the presence of transparency, they may need to be applied earlier than the actual rendering of colour onto the page.

The rendering intent influences the conversion from a CIE-based colour space to a target colour space, taking into account the target space's colour gamut (the range of colours it can reproduce). Whereas in the opaque imaging model the target space shall always be the native colour space of the output device, in the transparent model it may instead be the group colour space of a transparency group into which an object is being painted.

The rendering intent is needed at the moment such a conversion is performed-that is, when painting an elementary or group object specified in a CIE-based colour space into a parent group having a different colour space.

  • NOTE 1 This differs from the current halftone and transfer function, whose values are used only when all colour compositing has been completed and rasterization is being performed.

In all cases, the rendering intent to use for converting an object's colour (whether that of an elementary object or of a transparency group) shall be determined by the rendering intent parameter associated with the object. In particular:

  • When painting an elementary object with a CIE-based colour into a transparency group having a different colour space, the rendering intent used shall be the current rendering intent in effect in the graphics state at the time of the painting operation.
  • When painting a transparency group whose colour space is CIE-based into a parent group having a different colour space, the rendering intent used shall be the current rendering intent in effect at the time the Do operator is applied to the group.
  • When the colour space of the page group is CIE-based, the rendering intent used to convert colours to the native colour space of the output device shall be the default rendering intent for the page.
  • NOTE 2 Since there may be one or more nested transparency groups having different CIE-based colour spaces, the colour of an elementary source object may be converted to the device colour space in multiple stages, controlled by the rendering intent in effect at each stage. The proper choice of rendering intent at each stage depends on the relative gamuts of the source and target colour spaces. It is specified explicitly by the document producer, not prescribed by the PDF specification, since no single policy for managing rendering intents is appropriate for all situations.

A similar approach works for the black-generation and undercolor-removal functions, which shall be applied only during conversion from DeviceRGB to DeviceCMYK colour spaces:

  • When painting an elementary object with a DeviceRGB colour directly into a transparency group whose colour space is DeviceCMYK , the functions used shall be the current black-generation and undercolorremoval functions in effect in the graphics state at the time of the painting operation.
  • When painting a transparency group whose colour space is DeviceRGB into a parent group whose colour space is DeviceCMYK , the functions used shall be the ones in effect at the time the Do operator is applied to the group.
  • When the colour space of the page group is DeviceRGB and the native colour space of the output device is DeviceCMYK , the functions used to convert colours to the device's colour space shall be the default functions for the page.


Navigation: PDF-Spec-11-Soft-Masks | PDF-Spec-Index | Next →

Clone this wiki locally