The space a page mixes its colours in
Say which colour space a page's marks mix in with each other, for the same result everywhere.
Summary
When two half-transparent colours overlap, something has to decide how they combine. Depending on the way of counting, the result is not quite the same: a half-transparent red laid over a blue can turn out slightly differently from one device to the next. Fixing the rule once, for the whole page, is what makes the printed sheet match the screen.
Technically
Written at the top level of a request, under
"transparency"
transparency makes every page a transparency /Group — /S /Transparency with the space in /CS — so its marks composite among themselves in the space named here, rather than in whatever space each of them happened to be painted in. That is what makes a half-opaque red over a blue come to the same colour wherever the page is shown. The space named is one color_spaces declares; /I and /K complete the group, isolation and knockout.
Request schema
-
transparency— object, optional, absent by default. -
transparency.space— string, required. The name of a colour space declared bycolor_spaces. A name the request did not declare is refused, and the answer names it. -
transparency.isolated— boolean, optional,falseby default. The group starts from nothing rather than from what lies behind the page. -
transparency.knockout— boolean, optional,falseby default. A mark inside the group replaces what an earlier mark of the same group put down, rather than compositing with it. -
The setting holds for every page of the document. The opacity and blend mode of one particular shape are set through
graphics_states.
A whole request that creates a PDF
{
"color_spaces": [
{
"name": "blend",
"space": { "cal_rgb": { "white_point": [0.9505, 1.0, 1.089] } }
}
],
"transparency": { "space": "blend", "isolated": true },
"graphics_states": [{ "name": "half", "state": { "fill_alpha": 0.5 } }],
"items": [
{
"type": "rect",
"rect": { "llx": 60, "lly": 700, "urx": 200, "ury": 790 },
"fill": [0.85, 0.15, 0.15]
},
{
"type": "rect",
"rect": { "llx": 140, "lly": 660, "urx": 280, "ury": 750 },
"fill": [0.15, 0.3, 0.85],
"graphics_state": "half"
}
]
}
Colour and how it is shown
The device the colours are stated for Which plate of a separated sheet a page is The device one page's colours are stated for Declaring colour beyond red, green and blue What a page's bare numbers mean A colour sliding into another Opacity, mixing, and what a press asks for A cell repeated to fill a shape
Where to go next
Every JSON key of a request, in one page The other forty-one settings of a request