# How do I compute the luminance of a pixel?

I have a color (say $R=100, G=150, B=130$). How do I compute its intensity?

Do I just sum up all three components? Or are the colors not evenly weighted?

The colors are not evenly interpreted by our eyes. When I want to make a picture gray scale, I usually go for the following calculation of the luminance of a pixel.

luminance = (r * 0.3) + (g * 0.59) + (b * 0.11)


Read more in the Stackoverflow question Formula to determine brightness of RGB color.