POV-Ray : Newsgroups : povray.newusers : Dealing with colours : Re: Dealing with colours Server Time
29 Jul 2024 10:29:12 EDT (-0400)
  Re: Dealing with colours  
From: kurtz le pirate
Date: 16 Mar 2006 14:53:22
Message: <kurtzlepirate-DE95B4.20532216032006@news.povray.org>
In article <web.44197dce2ff0c10ff039f4f00@news.povray.org>,
 "ChaoZ" <nomail@nomail> wrote:

> One final thing, is it possible to use CMYK values in POVRay? The biggest
> problem I was having was controlling the lightness and darkness of a
> colour.


strange thing... cmyk space is for print. of corse you can always use 
any space colors en pov in writing small macro to switch for one space 
to an other.


from <http://en.wikipedia.org/wiki/CMYK> Converting CMYK to RGB

To convert, we first convert CMYK to CMY, then convert the CMY value to 
RGB. Converting now tCMYK = {C,M,Y,K}

then
  tCMY = {C',M',Y'} = {C(1 - K) + K,M(1 - K) + K,Y(1 - K) + K}
and
  tRGB = {R,G,B} = {1 - C',1 - M',1 - Y'}
or substituting in
  tRGB = {1 - (C(1 - K) + K),1 - (M(1 - K) + K),1 - (Y(1 - K) + K)}
       = {1 - C(1 - K) - K, 1 - M(1 - K) - K, 1 - Y(1 - K) - K} 

suppose you declare your macro like that :
#macro cmyk2rgb(cc,mm,yy,kk)
  ...hard compute here...
  rgb<rr,gg,bb>
#end

you can now use cmyk space in pigment : 





-- 
klp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.