# Converting 24bits RGB to 8 bit Grayscale

This is a discussion on Converting 24bits RGB to 8 bit Grayscale within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I = 0.2989 * R + 0.5870 * G + 0.1140 * B To convert 24bits RGB to 8bits grayscale, ...

1. ## Converting 24bits RGB to 8 bit Grayscale

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?

2. 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.