Yeah, I take my color and multiply each r,g,b
by the gray value for the pixel:
[r|g|b]1 are inputs
[r|g|b]2 are outputs
gr = 0.30 * r1 + 0.59 * g1 + 0.11 * b1; // get brightness
r2 = gr * 1; // add tint
g2 = gr * 0.71;
b2 = gr * 0.41;
if u don't satisfy the effect of the hue , u can also do some other manipulation.
e.g. increase the contrast
r2 = r2* a;
if(r2 > 255)
r2 = 255;
g2 = g2* a;
if(g2 > 255)
g2 = 255;
b2 = b2* a;
if(b2 > 255)
b2 = 255;
Thank you very much!
by the gray value for the pixel:
[r|g|b]1 are inputs
[r|g|b]2 are outputs
gr = 0.30 * r1 + 0.59 * g1 + 0.11 * b1; // get brightness
r2 = gr * 1; // add tint
g2 = gr * 0.71;
b2 = gr * 0.41;
if u don't satisfy the effect of the hue , u can also do some other manipulation.
e.g. increase the contrast
r2 = r2* a;
if(r2 > 255)
r2 = 255;
g2 = g2* a;
if(g2 > 255)
g2 = 255;
b2 = b2* a;
if(b2 > 255)
b2 = 255;
Thank you very much!
'프로그래밍 > 그래픽&이미지' 카테고리의 다른 글
3D Studio max에서 기본 단위를 mm로 설정하는 방법 (0) | 2009.11.10 |
---|---|
CxImage의 Auto Level 함수들에 대해. (0) | 2006.10.17 |