跳转至

附录 K(资料性)PostScript 兼容性 - 透明成像模型

Annex K (informative) PostScript Compatibility — Transparent Imaging Model

K.1 概述

K.1 General

由于 PostScript 语言不支持透明成像模型,因此想要在 PostScript 输出设备上打印的符合该标准的阅读器需要采取某种方式将使用透明度的文档的外观转换为纯不透明的描述。

Because the PostScript language does not support the transparent imaging model, a conforming reader desiring to print on a PostScript output device needs to have some means for converting the appearance of a document that uses transparency to a purely opaque description.

K.2 转换

K.2 Conversion

将页面内容从透明形式转换为不透明形式需要结合形状分解和预渲染,以展平页面上的透明对象堆栈,执行所有必要的透明度计算,并仅使用不透明对象描述最终外观。页面是否包含需要展平的透明内容可以通过直接分析页面资源来确定;无需分析内容流本身。转换为不透明形式是不可逆的,因为有关如何产生透明效果的所有信息都会丢失。

为了正确执行透明度计算,符合要求的阅读器需要知道输出设备的原生色彩空间。当符合要求的阅读器直接控制输出设备时,这不是问题。但是,在生成 PostScript 输出时,符合要求的阅读器无法知道 PostScript 输出设备的原生色彩空间。错误的假设将破坏页面上出现的任何基于 CIE 的颜色的校准。可以通过以下两种方式之一解决此问题:

  • 如果整个页面由基于 CIE 的颜色组成,则将颜色扁平化为单个基于 CIE 的颜色空间,而不是设备颜色空间。如果页面具有指定基于 CIE 的颜色空间的组属性字典(页面对象中的组条目),则可以轻松确定用于此目的的首选颜色空间(请参阅 11.6.6,“透明度组 XObjects”)。
  • 否则,将颜色扁平化为具有预定校准的某个假定设备颜色空间。在生成的 PostScript 输出中,在具有该校准的基于 CIE 的颜色空间中绘制扁平颜色。

由于使用专色和将其转换为替代颜色空间之间的选择会影响印刷色的扁平结果,因此需要在 PostScript 转换期间决定要假设的可用专色集。(这与严格不透明的绘画不同,在严格不透明的绘画中,可以推迟到执行生成的 PostScript 代码后再做出决定。)

Converting the contents of a page from transparent to opaque form entails some combination of shape decomposition and prerendering to flatten the stack of transparent objects on the page, performing all the needed transparency computations, and describing the final appearance using opaque objects only. Whether the page contains transparent content needing to be flattened can be determined by straightforward analysis of the page’s resources; it is not necessary to analyse the content stream itself. The conversion to opaque form is irreversible, since all information about how the transparency effects were produced is lost.

To perform the transparency computations properly, the conforming reader needs to know the native colour space of the output device. This is no problem when the conforming reader controls the output device directly. However, when generating PostScript output, the conforming reader has no way of knowing the native colour space of the PostScript output device. An incorrect assumption will ruin the calibration of any CIE-based colours appearing on the page. This problem can be addressed in either of two ways:

  • If the entire page consists of CIE-based colours, flatten the colours to a single CIE-based colour space rather than to a device colour space. The preferred colour space for this purpose can easily be determined if the page has a group attributes dictionary (Group entry in the page object) specifying a CIE-based colour space (see 11.6.6, "Transparency Group XObjects").
  • Otherwise, flatten the colours to some assumed device colour space with predetermined calibration. In the generated PostScript output, paint the flattened colours in a CIE-based colour space having that calibration.

Because the choice between using spot colorants and converting them to an alternate colour space affects the flattened results of process colours, a decision needs to be made during PostScript conversion about the set of available spot colorants to assume. (This differs from strictly opaque painting, where the decision can be deferred until the generated PostScript code is executed.)