Repository navigation
PDF Spec 08 Clipping Paths
Part of: PDF-Spec-08-Graphics
Navigation: PDF-Spec-08-Path-Construction | PDF-Spec-Index | PDF-Spec-08-Color-Spaces
% Set DeviceRGB colour space
red green blue SC
% Set colour
red green blue RG
% Set both in one operation
The CS and SC operators shall select the current stroking colour space and current stroking colour separately; RG shall set them in combination. The cs , sc , and rg operators shall perform the same functions for nonstroking operations. Setting either current colour space to DeviceRGB shall initialize the red, green, and blue components of the corresponding current colour to 0.0.
The DeviceCMYK colour space allows colours to be specified according to the subtractive CMYK (cyanmagenta-yellow-black) model typical of printers and other paper-based output devices. The four components in a DeviceCMYK colour value shall represent the concentrations of these process colorants. Each component shall be a number in the range 0.0 to 1.0, where 0.0 shall denote the complete absence of a process colorant and 1.0 shall denote maximum concentration (absorbs as much as possible of the additive primary).
NOTE As much as the reflective colours (CMYK) decrease reflection with increased ink values and radiant colours (RGB) increases the intensity of colours with increased values the values work in an opposite manner.
EXAMPLE colour space and a specific colour within
The following shows alternative ways to select the DeviceCMYK that space for stroking operations.
/DeviceCMYK CS
% Set DeviceCMYK colour space
cyan magenta yellow black SC
% Set colour
cyan magenta yellow black K
% Set both in one operation
The CS and SC operators shall select the current stroking colour space and current stroking colour separately; K shall set them in combination. The cs , sc , and k operators shall perform the same functions for nonstroking operations. Setting either current colour space to DeviceCMYK shall initialize the cyan, magenta, and yellow components of the corresponding current colour to 0.0 and the black component to 1.0.
Calibrated colour in PDF shall be defined in terms of an international standard used in the graphic arts, television, and printing industries. CIE-based colour spaces enable a page description to specify colour values in a way that is related to human visual perception. The goal is for the same colour specification to produce consistent results on different output devices, within the limitations of each device; Figure L.2 in Annex L illustrates the kind of variation in colour reproduction that can result from the use of uncalibrated colour on different devices. PDF 1.1 supports three CIE-based colour space families, named CalGray , CalRGB , and Lab ; PDF 1.3 added a fourth, named ICCBased .
- NOTE 1 In PDF 1.1, a colour space family named CalCMYK was partially defined, with the expectation that its definition would be completed in a future version. However, this feature has been deprecated. PDF 1.3 and later versions support calibrated four-component colour spaces by means of ICC profiles (see 8.6.5.5, "ICCBased Colour Spaces"). A conforming reader should ignore CalCMYK colour space attributes and render colours specified in this family as if they had been specified using DeviceCMYK .
- NOTE 2 The details of the CIE colourimetric system and the theory on which it is based are beyond the scope of this specification; see the Bibliography for sources of further information. The semantics of CIE-based colour spaces are defined in terms of the relationship between the space's components and the tristimulus values X , Y , and Z of the CIE 1931 XYZ space. The CalRGB and Lab colour spaces (PDF 1.1) are special cases of three-component CIE-based colour spaces, known as CIE-based ABC colour spaces. These spaces are defined in terms of a two-stage, nonlinear transformation of the CIE 1931 XYZ space. The formulation of such colour spaces models a simple zone theory of colour vision, consisting of a nonlinear trichromatic first stage combined with a nonlinear opponent-colour second stage. This formulation allows colours to be digitized with minimum loss of fidelity, an important consideration in sampled images.
Colour values in a CIE-based ABC colour space shall have three components, arbitrarily named A , B , and C. The first stage shall transform these components by first forcing their values to a specified range, then applying decoding functions , and then multiplying the results by a 3-by-3 matrix, producing three intermediate components arbitrarily named L , M , and N . The second stage shall transform these intermediate components in a similar fashion, producing the final X , Y , and Z components of the CIE 1931 XYZ space (see Figure 22).
Figure 22 - Component Transformations in a CIE-based ABC Colour Space
Colour spaces in the CIE-based families shall be defined by an array
[ name dictionary ]
where name is the name of the family and dictionary is a dictionary containing parameters that further characterize the space. The entries in this dictionary have specific interpretations that depend on the colour space; some entries are required and some are optional. See the sub-clauses on specific colour space families for details.
Setting the current stroking or nonstroking colour space to any CIE-based colour space shall initialize all components of the corresponding current colour to 0.0 (unless the range of valid values for a given component does not include 0.0, in which case the nearest valid value shall be substituted.)
- NOTE 3 The model and terminology used hereCIE-based ABC (above) and CIE-based A (below)-are derived from the PostScript language, which supports these colour space families in their full generality. PDF supports specific useful cases of CIE-based ABC and CIE-based A spaces; most others can be represented as ICCBased spaces.
A CalGray colour space (PDF 1.1) is a special case of a single-component CIE-based colour space, known as a CIE-based A colour space. This type of space is the one-dimensional (and usually achromatic) analog of CIEbased ABC spaces. Colour values in a CIE-based A space shall have a single component, arbitrarily named A. Figure 23 illustrates the transformations of the A component to X , Y , and Z components of the CIE 1931 XYZ space.
Figure 23 - Component Transformations in a CIE-based A Colour Space
A CalGray colour space shall be a CIE-based A colour space with only one transformation stage instead of two. In this type of space, A represents the gray component of a calibrated gray space. This component shall be in the range 0.0 to 1.0. The decoding function (denoted by 'Decode A ' in Figure 23) is a gamma function whose coefficient shall be specified by the Gamma entry in the colour space dictionary (see Table 63). The transformation matrix denoted by 'Matrix A ' in the figure is derived from the dictionary's WhitePoint entry, as described below. Since there is no second transformation stage, 'Decode LMN ' and 'Matrix LMN ' shall be implicitly taken to be identity transformations.
Table 63 - Entries in a CalGray Colour Space Dictionary
| Key | Type | Value |
|---|---|---|
| WhitePoint | array | (Required) An array of three numbers [ X W Y W Z W ] specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point; see 8.6.5.3, "CalRGB Colour Spaces", for further discussion. The numbers X W and Z W shall be positive, and Y W shall be equal to 1.0. |
| BlackPoint | array | (Optional) An array of three numbers [ X B Y B Z B ] specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point; see 8.6.5.3, "CalRGB Colour Spaces", for further discussion. All three of these numbers shall be non-negative. Default value: [0.0 0.0 0.0]. |
| Gamma | number | (Optional) A number G defining the gamma for the gray (A) component. G shall be positive and is generally greater than or equal to 1. Default value: 1. |
The transformation defined by the Gamma and WhitePoint entries is
X L × = =
Y M × = =
Z N Z W A G × = =
In other words, the A component shall be first decoded by the gamma function, and the result shall be multiplied by the components of the white point to obtain the L , M , and N components of the intermediate representation. Since there is no second stage, the L , M , and N components shall also be the X , Y , and Z components of the final representation.
The examples in this sub-clause illustrate interesting and useful special cases of CalGray spaces. This example establishes a space consisting of the Y dimension of the CIE 1931 XYZ space with the CCIR XA/
- EXAMPLE 1 11-recommended D65 white point.
- EXAMPLE 2 This example establishes a calibrated gray space with the CCIR XA/11-recommended D65 white point and opto-electronic transfer function.
[ /CalGray << /WhitePoint [ 0.9505 1.0000 1.0890 ] >> ]
[ /CalGray << /WhitePoint [ 0.9505 1.0000 1.0890 ] /Gamma 2.222 >> ]
A CalRGB colour space is a CIE-based ABC colour space with only one transformation stage instead of two. In this type of space, A , B , and C represent calibrated red, green, and blue colour values. These three colour components shall be in the range 0.0 to 1.0; component values falling outside that range shall be adjusted to the nearest valid value without error indication. The decoding functions (denoted by 'Decode ABC ' in Figure 22) are gamma functions whose coefficients shall be specified by the Gamma entry in the colour space dictionary (see Table 64). The transformation matrix denoted by 'Matrix ABC ' in Figure 22 shall be defined by the dictionary's Matrix entry. Since there is no second transformation stage, 'Decode LMN ' and 'Matrix LMN ' shall be implicitly taken to be identity transformations.
Table 64 - Entries in a CalRGB Colour Space Dictionary
| Key | Type | Value |
|---|---|---|
| WhitePoint | array | (Required) An array of three numbers [ X W Y W Z W ] specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point; see below for further discussion. The numbers X W and Z W shall be positive, and Y W shall be equal to 1.0. |
| BlackPoint | array | (Optional) An array of three numbers [ X B Y B Z B ] specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point; see below for further discussion. All three of these numbers shall be non-negative. Default value: [0.0 0.0 0.0]. |
| Gamma | array | (Optional) An array of three numbers [ G R G G G B ] specifying the gamma for the red, green, and blue (A , B , and C) components of the colour space. Default value: [1.0 1.0 1.0]. |
| Matrix | array | (Optional) An array of nine numbers [ X A Y A Z A X B Y B Z B X C Y C Z C ] specifying the linear interpretation of the decoded A , B , and C components of the colour space with respect to the final XYZ representation. Default value: the identity matrix [1 0 0 0 1 0 0 0 1]. |
The WhitePoint and BlackPoint entries in the colour space dictionary shall control the overall effect of the CIE-based gamut mapping function described in sub-clause 10.2, "CIE-Based Colour to Device Colour". Typically, the colours specified by WhitePoint and BlackPoint shall be mapped to the nearly lightest and nearly darkest achromatic colours that the output device is capable of rendering in a way that preserves colour appearance and visual contrast.
WhitePoint represents the diffuse achromatic highlight, not a specular highlight. Specular highlights, achromatic or otherwise, are often reproduced lighter than the diffuse highlight. BlackPoint represents the diffuse achromatic shadow; its value is limited by the dynamic range of the input device. In images produced by a photographic system, the values of WhitePoint and BlackPoint vary with exposure, system response, and artistic intent; hence, their values are image-dependent.
The transformation defined by the Gamma and Matrix entries in the CalRGB colour space dictionary shall be
The A , B , and C components shall first be decoded individually by the gamma functions. The results shall be treated as a three-element vector and multiplied by Matrix (a 3-by-3 matrix) to obtain the L , M , and N components of the intermediate representation. Since there is no second stage, these shall also be the X , Y , and Z components of the final representation.
EXAMPLE The following shows an example of a CalRGB colour space for the CCIR XA/11-recommended D65 white point with 1.8 gammas and Sony Trinitron phosphor chromaticities.
[ /CalRGB << /WhitePoint [ 0.9505 1.0000 1.0890 ] /Gamma [ 1.8000 1.8000 1.8 000] /Matrix [ 0.4497 0.2446 0.0252 0.3163 0.6720 0.1412 0.1845 0.0833 0.9227 ] >> ]
The parameters of a CalRGB colour space may be specified in terms of the CIE 1931 chromaticity coordinates ( x R , y R ), ( x G , y G ), ( x B , y B ) of the red, green, and blue phosphors, respectively, and the chromaticity ( x W , y W ) of the diffuse white point corresponding to a linear RGB value ( R , G , B ), where R , G , and B should all equal 1.0. The standard CIE notation uses lowercase letters to specify chromaticity coordinates and uppercase letters to specify tristimulus values. Given this information, Matrix and WhitePoint shall be calculated as follows:
A Lab colour space is a CIE-based ABC colour space with two transformation stages (see Figure 22). In this type of space, A , B , and C represent the L *, a *, and b * components of a CIE 1976 L * a * b * space. The range of the first (L * ) component shall be 0 to 100; the ranges of the second and third (a * and b * ) components shall be defined by the Range entry in the colour space dictionary (see Table 65).
Figure L.3 in Annex L illustrates the coordinates of a typical Lab colour space; Figure L.4 in Annex L compares the gamuts (ranges of representable colours) for Lab* , RGB , and CMYK spaces.
Table 65 - Entries in a Lab Colour Space Dictionary
| Key | Type | Value |
|---|---|---|
| WhitePoint | array | (Required) An array of three numbers [ X W Y W Z W ] that shall specify the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point; see 8.6.5.3, "CalRGB Colour Spaces" for further discussion. The numbers X W and Z W shall be positive, and Y W shall be 1.0. |
| BlackPoint | array | (Optional) An array of three numbers [ X B Y B Z B ] that shall specify the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point; see 8.6.5.3, "CalRGB Colour Spaces" for further discussion. All three of these numbers shall be non-negative. Default value: [0.0 0.0 0.0]. |
| Range | array | (Optional) An array of four numbers [ a min a max b min b max ] that shall specify the range of valid values for the a * and b * ( B and C ) components of the colour space-that is, and Component values falling outside the specified range shall be adjusted to the nearest valid value without error indication. Default value: [ - 100 100 - 100 100]. a min a* a max ≤ ≤ b min b* b max ≤ ≤ |
A Lab colour space shall not specify explicit decoding functions or matrix coefficients for either stage of the transformation from L * a * b * space to XYZ space (denoted by 'Decode ABC ,' 'Matrix ABC ,' 'Decode LMN ,' and 'Matrix LMN ' in Figure 22). Instead, these parameters shall have constant implicit values. The first transformation stage shall be defined by the equations
The second transformation stage shall be
where the function g ( x ) shall be defined as
EXAMPLE
The following defines the CIE 1976 Lab* space with the CCIR XA/11-recommended D65 white point. The a* and b* components, although theoretically unbounded, are defined to lie in the useful range -128 to +127.
[ /Lab << /WhitePoint [ 0.9505 1.0000 1.0890 ] /Range [ -128 127 -128 127 ] >> ]
ICCBased colour spaces (PDF 1.3) shall be based on a cross-platform colour profile as defined by the International Color Consortium (ICC) (see, 'Bibliography'). Unlike the CalGray , CalRGB , and Lab colour spaces, which are characterized by entries in the colour space dictionary, an ICCBased colour space shall be characterized by a sequence of bytes in a standard format. Details of the profile format can be found in the ICC specification (see, 'Bibliography').
An ICCBased colour space shall be an array:
[ /ICCBased stream ]
The stream shall contain the ICC profile. Besides the usual entries common to all streams (see Table 5), the profile stream shall have the additional entries listed in Table 66.
Table 66 - Additional Entries Specific to an ICC Profile Stream Dictionary
| Key | Type | Value |
|---|---|---|
| N | integer | (Required) The number of colour components in the colour space described by the ICC profile data. This number shall match the number of components actually in the ICC profile. N shall be 1, 3, or 4. |
PDF 32000-1:2008
Table 66 - Additional Entries Specific to an ICC Profile Stream Dictionary (continued)
| Key | Type | Value |
|---|---|---|
| Alternate | array or name | (Optional) An alternate colour space that shall be used in case the one specified in the stream data is not supported. Non-conforming readers may use this colour space. The alternate space may be any valid colour space (except a Pattern colour space) that has the number of components specified by N . If this entry is omitted and the conforming reader does not understand the ICC profile data, the colour space that shall be used is DeviceGray , DeviceRGB , or DeviceCMYK , depending on whether the value of N is 1, 3, or 4, respectively. There shall not be conversion of source colour values, such as a tint transformation, when using the alternate colour space. Colour values within the range of the ICCBased colour space might not be within the range of the alternate colour space. In this case, the nearest values within the range of the alternate space shall be substituted. |
| Range | array | (Optional) An array of 2 × N numbers [ min 0 max 0 min 1 max 1 …] that shall specify the minimum and maximum valid values of the corresponding colour components. These values shall match the information in the ICC profile. Default value: [0.0 1.0 0.0 1.0 …]. |
| Metadata | stream | (Optional; PDF 1.4) A metadata stream that shall contain metadata for the colour space (see 14.3.2, "Metadata Streams"). |
The ICC specification is an evolving standard. Table 67 shows the versions of the ICC specification on which the ICCBased colour spaces that PDF versions 1.3 and later shall use. (Earlier versions of the ICC specification shall also be supported.)
Table 67 - ICC Specification Versions Supported by ICC Based Colour Spaces
| PDF Version | ICC Specification Version |
|---|---|
| 1.3 | 3.3 |
| 1.4 | ICC.1:1998-09 and its addendum ICC.1A:1999-04 |
| 1.5 | ICC.1:2001-12 |
| 1.6 | ICC.1:2003-09 |
| 1.7 | ICC.1:2004-10 (ISO 15076-1:2005) |
Conforming writers and readers should follow these guidelines:
- A conforming reader shall support ICC.1:2004:10 as required by PDF 1.7, which will enable it to properly render all embedded ICC profiles regardless of the PDF version.
- A conforming reader shall always process an embedded ICC profile according to the corresponding version of the PDF being processed as shown in Table 67 above; it shall not substitute the Alternate colour space in these cases.
- A conforming writer should use ICC 1:2004-10 profiles. It may embed profiles conforming to a later ICC version. The conforming reader should process such profiles according to Table 67; if that is not possible, it shall substitute the Alternate colour space.
- Conforming writers shall only use the profile types shown in Table 68 for specifying calibrated colour spaces for colouring graphic objects. Each of the indicated fields shall have one of the values listed for that field in the second column of the table. Profiles shall satisfy both the criteria shown in the table. The terminology is taken from the ICC specifications.
Table 68 - ICC Profile Types
| Header Field | Required Value |
|---|---|
| deviceClass | icSigInputClass ('scnr') icSigDisplayClass ('mntr') icSigOutputClass ('prtr') icSigColorSpaceClass ('spac') |
| colorSpace | icSigGrayData ('GRAY') icSigRgbData ('RGB ') icSigCmykData ('CMYK') icSigLabData ('Lab ') |
The terminology used in PDF colour spaces and ICC colour profiles is similar, but sometimes the same terms are used with different meanings. The default value for each component in an ICCBased colour space is 0. The range of each colour component is a function of the colour space specified by the profile and is indicated in the ICC specification. The ranges for several ICC colour spaces are shown in Table 69.
Table 69 - Ranges for Typical ICC Colour Spaces
| ICC Colour Space | Component Ranges |
|---|---|
| Gray | [0.0 1.0] |
| RGB | [0.0 1.0] |
| CMYK | [0.0 1.0] |
| Lab* | L *: [0 100]; a * and b *: [ - 128 127] |
Since the ICCBased colour space is being used as a source colour space, only the 'to CIE' profile information ( AToB in ICC terminology) shall be used; the 'from CIE' ( BToA ) information shall be ignored when present. An ICC profile may also specify a rendering intent , but a conforming reader shall ignore this information; the rendering intent shall be specified in PDF by a separate parameter (see 8.6.5.8, "Rendering Intents").
The requirements stated above apply to an ICCBased colour space that is used to specify the source colours of graphics objects. When such a space is used as the blending colour space for a transparency group in the transparent imaging model (see 11.3.4, "Blending Colour Space"; 11.4, "Transparency Groups"; and 11.6.6, "Transparency Group XObjects"), it shall have both 'to CIE' (AToB) and 'from CIE' (BToA) information. This is because the group colour space shall be used as both the destination for objects being painted within the group and the source for the group's results. ICC profiles shall also be used in specifying output intents for matching the colour characteristics of a PDF document with those of a target output device or production environment. When used in this context, they shall be subject to still other constraints on the 'to CIE' and 'from CIE' information; see 14.11.5, "Output Intents", for details.
The representations of ICCBased colour spaces are less compact than CalGray , CalRGB , and Lab , but can represent a wider range of colour spaces.
- NOTE 2 One particular colour space is the 'standard RGB ' or sRGB , defined in the International Electrotechnical Commission (IEC) document Color Measurement and Management in Multimedia Systems and Equipment (see, 'Bibliography'). In PDF, the sRGB colour space can only be expressed as an ICCBased space, although it can be approximated by a CalRGB space.
- EXAMPLE The following shows an ICCBased colour space for a typical three-component RGB space. The profile's data has been encoded in hexadecimal representation for readability; in actual practice, a lossless decompression filter such as FlateDecode should be used.
10 0 obj [ /ICCBased 15 0 R ]
% Colour space
endobj 15 0 obj % ICC profile stream << /N 3 /Alternate /DeviceRGB /Length 1605 /Filter /ASCIIHexDecode >> stream 00 00 02 0C 61 70 70 6C 02 00 00 00 6D 6E 74 72 52 47 42 20 58 59 5A 20 07 CB 00 02 00 16 00 0E 00 22 00 2C 61 63 73 70 41 50 50 4C 00 00 00 00 61 70 70 6C 00 00 04 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 F6 D4 00 01 00 00 00 00 D3 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 64 65 73 63 00 00 00 F0 00 00 00 71 72 58 59 5A 00 00 01 64 00 00 00 14 67 58 59 5A 00 00 01 78 00 00 00 14 62 58 59 5A 00 00 01 8C 00 00 00 14 72 54 52 43 00 00 01 A0 00 00 00 0E 67 54 52 43 00 00 01 B0 00 00 00 0E 62 54 52 43 00 00 01 C0 00 00 00 0E 77 74 70 74 00 00 01 D0 00 00 00 14 63 70 72 74 00 00 01 E4 00 00 00 27 64 65 73 63 00 00 00 00 00 00 00 17 41 70 70 6C 65 20 31 33 22 20 52 47 42 20 53 74 61 6E 64 61 72 64 00 00 00 00 00 00 00 00 00 00 00 17 41 70 70 6C 65 20 31 33 22 20 52 47 42 20 53 74 61 6E 64 61 72 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 59 5A 58 59 5A 20 00 00 00 00 00 00 63 0A 00 00 35 0F 00 00 03 30 58 59 5A 20 00 00 00 00 00 00 53 3D 00 00 AE 37 00 00 15 76 58 59 5A 20 00 00 00 00 00 00 40 89 00 00 1C AF 00 00 BA 82 63 75 72 76 00 00 00 00 00 00 00 01 01 CC 63 75 63 75 72 76 00 00 00 00 00 00 00 01 01 CC 63 75 63 75 72 76 00 00 00 00 00 00 00 01 01 CC 58 59 58 59 5A 20 00 00 00 00 00 00 F3 1B 00 01 00 00 00 01 67 E7 74 65 78 74 00 00 00 00 20 43 6F 70 79 72 69 67 68 74 20 41 70 70 6C 65 20 43 6F 6D 70 75 74 65 72 73 20 31 39 39 34 00 > endstream endobj
Colours that are specified in a device colour space ( DeviceGray , DeviceRGB , or DeviceCMYK ) are devicedependent. By setting default colour spaces (PDF 1.1) , a conforming writer can request that such colours shall be systematically transformed (remapped) into device-independent CIE-based colour spaces. This capability can be useful in a variety of circumstances:
- A document originally intended for one output device is redirected to a different device.
- A document is intended to be compatible with non-compliant readers and thus cannot specify CIE-based colours directly.
- Colour corrections or rendering intents need to be applied to device colours (see 8.6.5.8, "Rendering Intents").
A colour space is selected for painting each graphics object. This is either the current colour space parameter in the graphics state or a colour space given as an entry in an image XObject, inline image, or shading
dictionary. Regardless of how the colour space is specified, it shall be subject to remapping as described below.
When a device colour space is selected, the ColorSpace subdictionary of the current resource dictionary (see 7.8.3, "Resource Dictionaries") is checked for the presence of an entry designating a corresponding default colour space ( DefaultGray , DefaultRGB , or DefaultCMYK , corresponding to DeviceGray , DeviceRGB , or DeviceCMYK , respectively). If such an entry is present, its value shall be used as the colour space for the operation currently being performed.
Colour values in the original device colour space shall be passed unchanged to the default colour space, which shall have the same number of components as the original space. The default colour space should be chosen to be compatible with the original, taking into account the components' ranges and whether the components are additive or subtractive. If a colour value lies outside the range of the default colour space, it shall be adjusted to the nearest valid value.
Any colour space other than a Lab , Indexed , or Pattern colour space may be used as a default colour space and it should be compatible with the original device colour space as described above.
If the selected space is a special colour space based on an underlying device colour space, the default colour space shall be used in place of the underlying space. This shall apply to the following colour spaces:
- The underlying colour space of a Pattern colour space
- The base colour space of an Indexed colour space
- The alternate colour space of a Separation or DeviceN colour space (but only if the alternate colour space is actually selected)
See 8.6.6, "Special Colour Spaces", for details on these colour spaces.
There is no conversion of colour values, such as a tint transformation, when using the default colour space. Colour values that are within the range of the device colour space might not be within the range of the default colour space (particularly if the default is an ICCBased colour space). In this case, the nearest values within the range of the default space are used. For this reason, a Lab colour space shall not be used as the DefaultRGB colour space.
In cases where a source colour space accurately represents the particular output device being used, a conforming reader should avoid converting the component colour values but use the source values directly as output values. This avoids any unwanted computational error and in the case of 4 component colour spaces avoids the conversion from 4 components to 3 and back to 4, a process that loses critical colour information.
-
NOTE 1 In workflows in which PDF documents are intended for rendering on a specific target output device (such as a printing press with particular inks and media), it is often useful to specify the source colours for some or all of a document's objects in a CIE-based colour space that matches the calibration of the intended device. The resulting document, although tailored to the specific characteristics of the target device, remains deviceindependent and will produce reasonable results if retargeted to a different output device. However, the expectation is that if the document is printed on the intended target device, source colours that have been specified in a colour space matching the calibration of the device will pass through unchanged, without conversion to and from the intermediate CIE 1931 XYZ space as depicted in Figure 22.
-
NOTE 2 In particular, when colours intended for a CMYK output device are specified in an ICCBased colour space using a matching CMYK printing profile, converting such colours from four components to three and back is unnecessary and results in a loss of fidelity in the black component. In such cases, a conforming reader may provide the ability for the user to specify a particular calibration to use for printing, proofing, or previewing. This calibration is then considered to be that of the native colour space of the intended output device (typically DeviceCMYK ), and colours expressed in a CIE-based source colour space matching it can be treated as if they were specified directly in the device's native colour space.
-
NOTE 3 The conditions under which such implicit conversion is done cannot be specified in PDF, since nothing in PDF describes the calibration of the output device (although an output intent dictionary, if present, may suggest such a calibration; see 14.11.5, "Output Intents"). The conversion is completely hidden by the conforming reader and plays no part in the interpretation of PDF colour spaces.
When this type of implicit conversion is done, all of the semantics of the device colour space shall also apply, even though they do not apply to CIE-based spaces in general. In particular:
- The nonzero overprint mode (see 8.6.7, "Overprint Control") shall determine the interpretation of colour component values in the space.
- If the space is used as the blending colour space for a transparency group in the transparent imaging model (see 11.3.4, "Blending Colour Space"; 11.4, "Transparency Groups"; and 11.6.6, "Transparency Group XObjects"), components of the space, such as Cyan , may be selected in a Separation or DeviceN colour space used within the group (see 8.6.6.4, "Separation Colour Spaces" and 8.6.6.5, "DeviceN Colour Spaces").
- Likewise, any uses of device colour spaces for objects within such a transparency group have well-defined conversions to the group colour space.
- NOTE 4 A source colour space can be specified directly (for example, with an ICCBased colour space) or indirectly using the default colour space mechanism (for example, DefaultCMYK ; see 8.6.5.6, "Default Colour Spaces"). The implicit conversion of a CIE-based colour space to a device space should not depend on whether the CIEbased space is specified directly or indirectly.
Although CIE-based colour specifications are theoretically device-independent, they are subject to practical limitations in the colour reproduction capabilities of the output device. Such limitations may sometimes require compromises to be made among various properties of a colour specification when rendering colours for a given device. Specifying a rendering intent (PDF 1.1) allows a conforming writer to set priorities regarding which of these properties to preserve and which to sacrifice.
- EXAMPLE The conforming writer might request that colours falling within the output device's gamut (the range of colours it can reproduce) be rendered exactly while sacrificing the accuracy of out-of-gamut colours, or that a scanned image such as a photograph be rendered in a perceptually pleasing manner at the cost of strict colourimetric accuracy.
Rendering intents shall be specified with the ri operator (see 8.4.4, "Graphics State Operators"), the RI entry in a graphics state parameter dictionary (see 8.4.5, "Graphics State Parameter Dictionaries"), or with the Intent entry in image dictionaries (see 8.9.5, "Image Dictionaries"). The value shall be a name identifying the rendering intent. Table 70 lists the standard rendering intents that shall be recognized. Figure L.5 in Annex L illustrates their effects. These intents have been chosen to correspond to those defined by the International Color Consortium (ICC), an industry organization that has developed standards for device-independent colour. If a conforming reader does not recognize the specified name, it shall use the RelativeColorimetric intent by default.
- NOTE Note, however, that the exact set of rendering intents supported may vary from one output device to another; a particular device may not support all possible intents or may support additional ones beyond those listed in the table.
See 11.7.5, "Rendering Parameters and Transparency", and in particular 11.7.5.3, "Rendering Intent and Colour Conversions", for further discussion of the role of rendering intents in the transparent imaging model.
Table 70 - Rendering Intents
| Name | Description |
|---|---|
| AbsoluteColorimetric | Colours shall be represented solely with respect to the light source; no correction shall be made for the output medium's white point (such as the colour of unprinted paper). Thus, for example, a monitor's white point, which is bluish compared to that of a printer's paper, would be reproduced with a blue cast. In-gamut colours shall be reproduced exactly; out-of-gamut colours shall be mapped to the nearest value within the reproducible gamut. NOTE 1 This style of reproduction has the advantage of providing exact colour matches from one output medium to another. It has the disadvantage of causing colours with Y values between the medium's white point and 1.0 to be out of gamut. A typical use might be for logos and solid colours that require exact |
| RelativeColorimetric | Colours shall be represented with respect to the combination of the light source and the output medium's white point (such as the colour of unprinted paper). Thus, a monitor's white point can be reproduced on a printer by simply leaving the paper unmarked, ignoring colour differences between the two media. In-gamut colours shall be reproduced exactly; out-of-gamut colours shall be mapped to the nearest value within the reproducible gamut. NOTE 2 This style of reproduction has the advantage of adapting for the varying white points of different output media. It has the |
| Saturation | Colours shall be represented in a manner that preserves or emphasizes saturation. Reproduction of in-gamut colours may or may not be colourimetrically accurate. NOTE 3 A typical use might be for business graphics, where saturation is the most important attribute of the colour. |
| Perceptual | Colours shall be represented in a manner that provides a pleasing perceptual appearance. To preserve colour relationships, both in-gamut and out-of-gamut colours shall be generally modified from their precise colourimetric values. NOTE 4 A typical use might be for scanned images. |
Special colour spaces add features or properties to an underlying colour space. There are four special colour space families: Pattern , Indexed , Separation , and DeviceN .
A Pattern colour space (PDF 1.2) specifies that an area is to be painted with a pattern rather than a single colour. The pattern shall be either a tiling pattern (type 1) or a shading pattern (type 2). 8.7, "Patterns", discusses patterns in detail.
An Indexed colour space specifies that an area is to be painted using a colour map or colour table of arbitrary colours in some other space. A conforming reader shall treat each sample value as an index into the colour table and shall use the colour value it finds there. This technique can considerably reduce the amount of data required to represent a sampled image.
An Indexed colour space shall be defined by a four-element array:
[ /Indexed base hival lookup ]
The first element shall be the colour space family name Indexed . The remaining elements shall be parameters that an Indexed colour space requires; their meanings are discussed below. Setting the current stroking or nonstroking colour space to an Indexed colour space shall initialize the corresponding current colour to 0.
The base parameter shall be an array or name that identifies the base colour space in which the values in the colour table are to be interpreted. It shall be any device or CIE-based colour space or (PDF 1.3) a Separation or DeviceN space, but shall not be a Pattern space or another Indexed space. If the base colour space is DeviceRGB , the values in the colour table shall be interpreted as red, green, and blue components; if the base colour space is a CIE-based ABC space such as a CalRGB or Lab space, the values shall be interpreted as A , B , and C components.
The hival parameter shall be an integer that specifies the maximum valid index value. The colour table shall be indexed by integers in the range 0 to hival . hival shall be no greater than 255, which is the integer required to index a table with 8-bit index values.
The colour table shall be defined by the lookup parameter, which may be either a stream or (PDF 1.2) a byte string. It shall provide the mapping between index values and the corresponding colours in the base colour space.
The colour table data shall be m ¥ ( hival + 1) bytes long, where m is the number of colour components in the base colour space. Each byte shall be an unsigned integer in the range 0 to 255 that shall be scaled to the range of the corresponding colour component in the base colour space; that is, 0 corresponds to the minimum value in the range for that component, and 255 corresponds to the maximum.
The colour components for each entry in the table shall appear consecutively in the string or stream.
- EXAMPLE 1
If the base colour space is DeviceRGB and the indexed colour space contains two colours, the order of bytes in the string or stream is R 0 G 0 B 0 R 1 G 1 B 1 , where letters denote the colour component and numeric subscripts denote the table entry.
EXAMPLE 1 The following illustrates the specification of an Indexed colour space that maps 8-bit index values to three-component colour values in the DeviceRGB colour space.
[ /Indexed /DeviceRGB 255 < 000000 FF0000 00FF00 0000FF B57342 … > ]
The example shows only the first five colour values in the lookup string; in all, there should be 256 colour values and the string should be 768 bytes long. Having established this colour space, the program can now specify colours as single-component values in the range 0 to 255. For example, a colour value of 4 selects an RGB colour whose components are coded as the hexadecimal integers B5, 73, and 42.
Dividing these by 255 and scaling the results to the range 0.0 to 1.0 yields a colour with red, green, and blue components of 0.710, 0.451, and 0.259, respectively.
Although an Indexed colour space is useful mainly for images, index values can also be used with the colour selection operators SC , SCN , sc , and scn .
EXAMPLE 2 The following selects the same colour as does an image sample value of 123.
123 sc
The index value should be an integer in the range 0 to hival . If the value is a real number, it shall be rounded to the nearest integer; if it is outside the range 0 to hival , it shall be adjusted to the nearest value within that range.
A Separation colour space (PDF 1.2) provides a means for specifying the use of additional colorants or for isolating the control of individual colour components of a device colour space for a subtractive device. When such a space is the current colour space, the current colour shall be a single-component value, called a tint , that controls the application of the given colorant or colour components only.
- NOTE 1 Colour output devices produce full colour by combining primary or process colorants in varying amounts. On an additive colour device such as a display, the primary colorants consist of red, green, and blue phosphors; on a subtractive device such as a printer, they typically consist of cyan, magenta, yellow, and sometimes black inks. In addition, some devices can apply special colorants, often called spot colorants , to produce effects that cannot be achieved with the standard process colorants alone. Examples include metallic and fluorescent colours and special textures.
- NOTE 2 When printing a page, most devices produce a single composite page on which all process colorants (and spot colorants, if any) are combined. However, some devices, such as imagesetters, produce a separate, monochromatic rendition of the page, called a separation , for each colorant. When the separations are later combined-on a printing press, for example-and the proper inks or other colorants are applied to them, the result is a full-colour page.
- NOTE 3 The term separation is often misused as a synonym for an individual device colorant. In the context of this discussion, a printing system that produces separations generates a separate piece of physical medium (generally film) for each colorant. It is these pieces of physical medium that are correctly referred to as separations. A particular colorant properly constitutes a separation only if the device is generating physical separations, one of which corresponds to the given colorant. The Separation colour space is so named for historical reasons, but it has evolved to the broader purpose of controlling the application of individual colorants in general, regardless of whether they are actually realized as physical separations.
Navigation: PDF-Spec-08-Path-Construction | PDF-Spec-Index | PDF-Spec-08-Color-Spaces