[cairo] Spot colors (and CMYK)

ecir hana ecir.hana at gmail.com
Sat Jan 16 10:42:22 PST 2010


Thank you all for the replies and sorry for the delay on my part, I
was trying to think a bit about this for myself.

On Tue, Jan 12, 2010 at 9:16 PM, Carl Worth <cworth at cworth.org> wrote:
>  * Concrete use case to describe what is missing at the
>    application<->cairo boundary.

A graphic editor exporting print-ready PDFs.

In my opinion there is missing the possibility to define two things: a
subtractive color and a fallback in case the color is not supported on
the desired output device.

* Subtractive color

After reading the posts above a few times I think there was a bit of
confusion - I was specifically talking about subtractive color spaces,
i.e. no sRGB, no BGRA, no CIE. In my opinion, converting between
various color spaces and color management is just too complex and
perhaps should be left out to the application or another library. My
question was just about the possibility to say "spot color" in Cairo
not its actual appearance on the screen. Side note: in my opinion,
color management is just too complex and I have yet to see it used in
practice and if someone suggests "not to do color spaces for printing,
as doing the conversion is ink dependent and is best left to the
printers" I very much agree with it.

By "subtractive color" I actually mean just one very board thing -
"DeviceN". Think of it as one or more spot colors. In turn, a spot
color is just a name (as in "const char *name"), perhaps with
associated intensity value called "tint".

* Fallback

It is almost certain that in the process of getting the print out it
will go through several devices which wont have the right spot colors.
This includes screen previews and proof-readings on a printer. So if I
say "gold" color, I think it is perfectly ok to display it on screen
as yellow, to print it on a printer as yellow, as long as it comes out
from the final output device (press) as golden. Now, the question is
whether do this automatically (implicitly) or explicitly specify what
to do. I must admit this is rather ultra-opinion on my side, but I
think that the first option, i.e. to work just in RGB (or some generic
united color space) simply does not work. Therefore one needs to be
able to specify how to convert a color from one space to another.

I was hoping that it could be enough to specify a spot color directly
with a fallback, e.g. 40% gold is 10% 0% 100% 0% CMYK, without the
need to specify which color space it belongs to. Unfortunately, this
quickly becomes rather unpractical as, for instance for images, one
would need to specify very many spot colors and fallbacks.

* Other option would be to copy exactly what PDF does:

- a Cairo surface would be either additive or subtractive, that is
RGB(A) or DeviceN

- while creating DeviceN surface one must specify the names of its
colorants and how to convert its colors to CMYK (so called
"tintTransorm"). Why CMYK? I didn't want to supply two tintTransforms
and I assume it is more important to stay in subtractive color space
than to display it more accurately on the screen. If the DeviceN would
be shown at screen, it converts to CMYK (explicitly). Then the
conversion from CMYK -> RGB would happen automatically (implicit) as
one understands that the yellow on screen is just a preview of golden.

- To actually paint with a color one would need to specify two things:
first the color space (instance of some concrete DeviceN or RGB),
second the tints (intensity values for each colorant in color space,
be it RGB(A) or DeviceN)

- There would be convenience functions for RGB and CMYK painting which
set both the color space and tints, say:
cairo_set_source_cmyk(double cyan, double magenta, double yellow, double black)

- While generating PS or PDF the surface could detect if the colorants
of DeviceN surface are Cyan, Magenta, Yellow, Black and if so use
DeviceCMYK color space, instead of DeviceN color space.

I apologize, this grew to a rather long post. To summarize: CMYK is
just a special case of DeviceN. Spot color is just a special case of
DeviceN with just one colorant. The intention was to introduce the
definition of colors beyond RGB, I'm less concerned with their actual
appearance as I believe one question is how to define a duotone
(Pantone 1234 + Black) picture in Cairo in the first place and is
different than the question of whether the appearance of 40% 80% color
in above space should be done in Cairo or left on the application or

What do you think?

More information about the cairo mailing list