Tuesday, January 19, 2010

desaturating

find the luminance, by separating out the components first, multiply each of the component with luma coefficients(ITUR Rec. 709 ) for RGB respectively. Add them up and mix original image with desaturated image with a matte, in this case a float. float red = comp(v1,0); float green = comp(v1,0); float blue = comp(v1,0); float luma = .2125*comp(v1, 0) + .7154*comp(v1, 1) + .0721*comp(v1, 2); result = mix(color(luma),v1,1-v2);

0 comments:

Post a Comment