[cairo] Subtractive API, part 0

ecir hana ecir.hana at gmail.com
Thu Jan 28 08:00:22 PST 2010


On Thu, Jan 28, 2010 at 1:09 PM, Arjen Nienhuis <a.g.nienhuis at gmail.com> wrote:

Thanks for the feedback!

> Your proposal assumes that its possible to do simple calculations on
> CMYK values. It's not.

It is. Because of two things:
- 90% black means that the raster simulating such color is comprised
of dots covering 90% of surface area. The fact, that the ink gets
soaked into the paper and the dots grow a bit ("dot gain") is
completely unrelated problem.
- it's just matter of definition: if I want half cmyk(0, 0, 1, 1) I
really mean cmyk(0, 0, 0.5, 0.5). If I want half gray, I mean
gray(0.5). How else do you what to say "half magenta" if not
magenta(0.5)?

> cmyk(0, 0, 1, 1) is (almost) black.

Yes.

> Painting this with 50% opacity on a white background should be (almost) gray.

You are already not doing CMYK calculations because you switch to
another color space (and you did that with the use of color
management).

> cmyk(0, 0, .5, .5) is beige and not gray.

Correct.

> That means that if i try to draw a cmyk(0, 0, 1, 1) box that is not pixel aligned I will get beige borders.

It will not. For drawing it will use the fallback which is going, even
with that super-simple conversion algorithm above, to be perfect gray,
because cmyk (0, 0, 0, 0) is most probably rgb(0, 0, 0) and half of
such black is rgb(127, 127, 127).

In other words, if it was done your way, i.e. CMYK -> some other color
space -> there cut it to half -> covert back to CMYK, you will never
get cmyk(0, 0, 0.5, 0.5) out of half cmyk(0, 0, 0.5, 0.5). You will
get something like cmyk(0.00123, 0.0173, 0.5763, 0.63454). But what if
you printer does not have cyan and magenta?

> New proposal:
>
> I think Cairo should not implement CMYK pixel surfaces

How else do you propose to load and  use CMYK and multi-channel pictures?


> Cairo can implement the SVG model and use:
>
> cairo_set_source_icc_color(cairo_t *cr, float srgb_fallback_r, float
> srgb_fallback_g, float srgb_fallback_b, cairo_profile_t *profile,
> <array of float>)

If I understand this correctly, *profile could be CMYK and <array> the
tints, am I right? How would a function for defining multiple spot
colors look like? Besides, in the proposal above you could supply sRGB
fallback for DeviceN, too.


More information about the cairo mailing list