RGB to monochrome conversion

Ashwin Nanjappa picture Ashwin Nanjappa · Aug 18, 2008 · Viewed 22k times · Source

How do I convert the RGB values of a pixel to a single monochrome value?

Answer

Ashwin Nanjappa picture Ashwin Nanjappa · Aug 18, 2008

I found one possible solution in the Color FAQ. The luminance component Y (from the CIE XYZ system) captures what is most perceived by humans as color in one channel. So, use those coefficients:

mono = (0.2125 * color.r) + (0.7154 * color.g) + (0.0721 * color.b);