PDA

View Full Version : Converting 24bits RGB to 8 bit Grayscale



FearOfTheDark
01-29-2003, 06:10 AM
I = 0.2989 * R + 0.5870 * G + 0.1140 * B

To convert 24bits RGB to 8bits grayscale, you can use the algorithmus, above.

What are the coefficients for? My friend told me that it had something with the colors luminanceto do!

OK, someone who knows?

adrianxw
01-29-2003, 06:17 AM
This is a guess off the top of my head, but the human eye is more responsive to certain frequencies then others. By simply reducing by summing the r,g and b components and dividing by 3, you are giving too much emphasis to the blue component for example, hence it is scaled down a little relative to the other colours, and so on.

The human eye is most sensitive to yellow/green so it kind of hangs together.

I must say, whenever I have done this I just (r + g + b)/3, looks good enough to me.