Tuesday, April 20, 2010

desaturating individual color components




















result = 0;
float r = comp(v1,0); 
float g = comp(v1,1); 
float b = comp(v1,2);
float lumr = .2125*comp(v1,0);
float lumg = .7154*comp(v1,1);
float lumb = .0721*comp(v1,2);
color desatr = mix(color(lumr), color(r,0,0), saturationr);
color desatg = mix(color(lumg), color(0,g,0), saturationg);
color desatb = mix(color(lumb), color(0,0,b), saturationb);
result = desatr+desatg+desatb;

0 comments:

Post a Comment