Log in

View Full Version : Convert to CMYK script ?


AnnaFan777
15th January 2010, 18:06
Convert to CMYK script ?

Black = minimum(1-Red,1-Green,1-Blue)
Cyan = (1-Red-Black)/(1-Black)
Magenta = (1-Green-Black)/(1-Black)
Yellow = (1-Blue-Black)/(1-Black)

Can anyone provide a script converting RGB to CMYK
format and put C,M,Y,K in R,G,B,ALPHA channel?

I'm new to this, any help would be appreciated..

Thanks..

LaTo
15th January 2010, 19:43
Convert to CMYK script ?

Black = minimum(1-Red,1-Green,1-Blue)
Cyan = (1-Red-Black)/(1-Black)
Magenta = (1-Green-Black)/(1-Black)
Yellow = (1-Blue-Black)/(1-Black)

Can anyone provide a script converting RGB to CMYK
format and put C,M,Y,K in R,G,B,ALPHA channel?

I'm new to this, any help would be appreciated..

Thanks..


Here is the code :

red = ShowRed("YV12")
green = ShowGreen("YV12")
blue = ShowBlue("YV12")

black = mt_logic(red,mt_logic(green,blue,"max",chroma="128"),"max",chroma="128")

cyan = mt_lutxy(red,black,"255 y x - * y /",chroma="128")
magenta = mt_lutxy(green,black,"255 y x - * y /",chroma="128")
yellow = mt_lutxy(blue,black,"255 y x - * y /",chroma="128")

MergeARGB(black,cyan,magenta,yellow)


But why do you want this? :confused:

Didée
15th January 2010, 19:57
Check the LUT string - e.g. when red=black, it results to zero. That shouldn't be, compare e.g. red=black=0.4 => cyan=0.3333

"255 x - y - 255 y - / 255 *"