加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 禾西 于 2012-4-11 18:01 编辑
假設 r g b 是原本圖像的色彩
grayfull = (r * 38 + g * 75 + b * 15) >> 7; r += tone.red + (grayfull - r) * tone.gray/256; g += tone.green + (grayfull - g) * tone.gray/256; b += tone.blue + (grayfull - b) * tone.gray/256; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255;
grayfull = (r * 38 + g * 75 + b * 15) >> 7;
r += tone.red + (grayfull - r) * tone.gray/256;
g += tone.green + (grayfull - g) * tone.gray/256;
b += tone.blue + (grayfull - b) * tone.gray/256;
if (r > 255) r = 255;
if (g > 255) g = 255;
if (b > 255) b = 255;
|