开发者

Converting byte number to grayscale and vica versa

I got a number between 0-255 and need to conve开发者_如何学Crt it to a RGB grayscale color. And how do I convert a RGB-color to a grayscale value between 0-255?


The common formula is luminosity = 0.30 * red + 0.59 * green + 0.11 * blue. Matches the human eye's color perception, doesn't otherwise correct for display device gamma.


If you have a number 0 <= x <= 255 representing a grayscale value, the corresponding RGB tuple is simply (x,x,x).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜