[Image-SIG] RGB to CMYK color conversion

Fredrik Lundh fredrik@pythonware.com
Sun, 18 Mar 2001 22:23:47 +0100


Kevin wrote:

> I was wondering if anyone has a better matrix for converting RGB to CMYK...
> the default conversion maps RGB directly to CMY, but does nothing with the
> black channel, leaving images very flat.

I'm not sure you can get much further without more drastic
measures.  something like (from memory, untested, pseudo-
code):

    cyan = 255 - red
    magenta = 255 - green
    yellow = 255 - blue
    black = max(cyan, magenta, yellow) * scale1
    cyan = clip(cyan * scale2 - black)
    magenta = clip(magenta * scale2 - black)
    yellow = clip(yellow * scale2 - black)
    black = clip(black)

might work a bit better.

(scale1 controls how much black to add, scale2 how much
colour to add.  scale1 should usually be slightly higher than
scale2).

this still doesn't take dot gain, ink characteristics, and all the
other intricacies of real-life colour printing into account, of
course.

Cheers /F