您的位置:首页 > 其它

RGB to Grayscaler

2014-07-23 10:51 375 查看
1. The lightness method averages the most prominent and least prominent colors:

(max(R, G, B) + min(R, G, B)) / 2.

2. The average method simply averages the values: (R + G + B) / 3.

3. The luminosity method is a more sophisticated version of the average method. It also averages the values, but it forms a weighted average to account for human perception. We’re more sensitive to green than other colors,
so green is weighted most heavily. The formula for luminosity is 0.21 R + 0.72 G + 0.07 B.



根据不同需求,选择不同的转换方式!

原文地址
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: