[cairo] Spot colors (and CMYK)

Russell Shaw rjshaw at netspace.net.au
Thu Feb 18 17:30:02 PST 2010

Bill Spitzak wrote:
> Russell Shaw wrote:

>> Storing negative values in sRGB is clearly a nonsense hack (square roots
>> and all that).
> True, and this is the biggest problem with saying "unclamped sRGB". 
> Microsoft with their scRGB definition have said that the conversion of 
> values greater than one follow the gamma curve, and negative numbers are 
> encoded as -f(-x). From previous experience with Microsoft standards I 
> am sure they thought about this for about 10 seconds, but unless we can 
> find a persuasive argument for different math I think using Microsoft's 
> definition is now the safest.
> It is also certainly true that composites are useless for these 
> out-of-gamut colors. Conversion to linear is needed before compositing 
> math. This is exactly what Nuke does. However I can warn you that there 
> are serious consequences that are going to hit a library used for vector 
> graphics like Cairo much worse than they hit Nuke. The problem is that 
> an awful lot of compositing relies on the "perceptually uniform" math 
> being done, the most obvious is the result of drawing the same-thickness 
> lines (or letters) in black or white on the opposite background. If the 
> antialiasing is done "correctly" in linear space, the user thinks the 
> white lines are far thinner or fainter than the black ones. But wrong 
> antialiasing done in sRGB looks "correct". Also users do not expect 
> their carefully painted partially-transparent overlay from Photoshop 
> will produce visible artifacts when composited.
> I do not have a solution to these problems. I wish I did. Linearizing 
> only outside the 0-1 range kind of works but the discontinuous slope at 
> 0 and 1 produced artifacts.

Discarding mathematical linearity for the sake of "perceptually uniform"
is a high price to pay.

If the most common case is for light letters on a dark background,
i'd hint the font renderer to change its rendering, or the font
renderer could even do all its rendering in nonlinear sRGB while
the rest of cairo remains linear.

For other cases such as thin lines in a drawing program, maybe users should
just accept the result as a fact of nature much like objects under flourescent
light look different than in sunlight.

More information about the cairo mailing list