Decomposing a DeviceN color
📌 Overview
In PDF, a DeviceN color space is a generalisation of both process and spot color models that allows an arbitrary set of named colorants—process components, spot inks, or any mixture of the two—to be combined into a single color space. Each component is identified by name, and a corresponding TintTransform provides a mapping from the DeviceN color values into an alternate process color space for cases where the target device cannot directly render all the named colorants. DeviceN exists to preserve high-level color intent in complex workflows: it allows content creators to express colors in terms of the inks they conceptually require, while deferring the decision of how those inks are realised to later stages of the rendering pipeline. In practice, however, the all-or-nothing nature of the TintTransform can lead to undesirable loss of spot information or flexibility, which motivates a more nuanced approach to handling DeviceN colors during rendering.
ℹ️ Example Scenarios
Case 1 - Not all spots are supported in the output
Consider a case where:
The RIP is configured to render to CMYK + PANTONE 032C
The job has a DeviceN color space where there is both PANTONE 032C and PANTONE Reflex Blue.
In these circumstances, the RIP will realize that not all the colorants in this DeviceN are supported, and will use the TintTransform to convert the color to process.
This means that the PANTONE 032C spot will not be preserved.
Case 2 - The process components are not supported in the output/group scenario
Consider a case where:
The RIP is configured to render to CMYK + PANTONE 032C
The job has a DeviceN color space with Cyan, Magenta, Yellow and PANTONE 032C
The content is being painted into an isolated RGB transparency group
In these circumstances, it’s the process components that are not available. The RIP will apply the TintTransform and convert through to RGB.
This means that the PANTONE 032C spot will not be preserved.
Case 3 - The customer wants to recolor a spot
Consider a case where:
The RIP is configured to render to CMYK
The customer wants to obtain a specific color value for a particular spot.
(Mako’s Apex renderer has a spot merging feature that can merge spot colors into the process components, using any color required. In this case, the job contains no overprint, so a post-processing step is unnecessary.)
For this scenario, a specific colour definition is to be used when the RIP sees this colorant, and not use the TintTransform as the RIP ordinarily would in this situation.
đź’Ş Conceptual Solution
The solution is to decompose the DeviceN colour space. That is, if not all colorants are supported, Mako will separate out the process, supported spot components, and unsupported spot components and then handle each separately before producing a final process + spot result, ignoring the TintTransform entirely.
Let’s look at the cases again and see how that would work.
Case 1 - Not all spots are supported in the output
This case has two spots, only one of which is supported. Apex will decompose into process, unsupported spots, and supported spots, which yields:
Process: none
Unsupported spots: PANTONE Reflex Blue
Supported spots: PANTONE 032C
Mako proceeds by deciding what color in the current process space PANTONE Reflex Blue is (more on this below) and then producing a process color result for that component. Please note, there are situations where this is not possible. (more on this below, too).
Apex then color manages the process color result as normal, and renders
On the spot pass, Apex renders PANTONE 032C as normal.
The end result is that PANTONE Reflex Blue is converted to process and the spot is retained.
Case 2 - The process components are not supported in the output/group scenario
This case has a spot and process mix. As we’re rendering CMYK process components to an RGB scenario, Apex would ordinarily have to run the TintTransform. Instead, we decompose the DeviceN as follows:
Process: Cyan, Magenta, Yellow
Unsupported spots: none
Supported spots: PANTONE 032C
When converting, Apex unpacks the process components (using 0 for the missing Black component). It then:
Color converts that as DeviceCMYK (using its intercept) to the group RGB color space and renders that color
The spot is rendered as normal on the process spot
Note: this solution works even if a spot is not present. If the DeviceN was just Cyan, Magenta and Yellow, then Apex will still extract the process components and color manage as if it were DeviceCMYK.
Case 3 - The customer wants to recolor a spot
In this scenario, we would go through the same steps. Let’s assume the color is LogoColor and specified in LAB. The same steps are followed, first by decomposing:
Process: none
Unsupported spots: LogoColour
Supported spots: none
The procedure is then the same as Case 2, above.
Apex determines what the color should be for LogoColor, merges that into the target process color space, and then processes as usual
There are no spots, so nothing else is required
The difference is that instead of Apex figuring out what the color should be, it must be told externally (more on that below).
Other cases
There are many other possibilities and permutations of the above, such as cases where we need to merge a spot into existing process components. All will need to follow the same decomposition/merging/management processes.
Apex API Changes and Usage
So there are two new renderspec fields to control this feature:
decomposeDeviceN- (defaultfalse) - This needs to be set to true to enable this feature.replacementSpotColors- This is a vector ofCColorantInfoobjects describing the color that should be used if a given spot needs to be converted to process. Any simple (i.e., not Indexed or DeviceN) color space may be used. This entry is ignored entirely ifdecomposeDeviceNisfalse.
For the most predictable results, it’s best that users specify an entry in replacementSpotColors for any spot that is not being dropped to ensure the best results. Should Apex be unable to determine the process value for a spot, it will abandon DeviceN decomposition for that color space. See Determining Colors for Spots below.
Process colorant name support
Apex supports CMYK and Gray colorant names. That is, Apex will recognize Cyan, Magenta, Yellow, Black and Gray. The first four imply DeviceCMYK, the latter DeviceGray (albeit inverted).
Should Apex encounter both CMYK and Gray colorant names (where they are not spots!) then it will give up and revert to using the TintTransform.
Determining Colors for Spots
When Apex needs to figure out the process color for a spot that needs to be merged, it will first look up the renderspec replacementSpotColors entry, and failing that will check to see if the DeviceN color space specifies the component.
If neither are found, Apex will give up and revert to using the tint transform.
Overprint
When Apex has to convert process components or merge a spot, then overprint is not used for those process components.
Any overprint will however be retained for spot components.