On Thu, 21 Feb 2002, Mike Ressler wrote: > Actually, the better way to do this is (xv Postscript code) > > gray = 0.32 * red + 0.5 * green + 0.18 * blue > > or perhaps (NTSC) > > gray = 0.30 * red + 0.59 * green + 0.11 * blue > > Either gives a better match to a human's RGB to luminance conversion. > Definitely not (R+G+B)/3!
This is true. I just couldn't remember the coefficients in my head, so I just gave you an approximation that should be good enough for starters. Just for background, you can actually do it better than the weighted-average. However, it's a pretty big job: 1) Convert the RGBs value of the image to a better, calibrated color space. Preferably, this should be based on the Munsell color system. Such a convertion requires information about the color space from the image, which is absent in 99% of all images. 2) Extract the lightness component of the Munsell color. This is easy. 3) Map the lightness component to the RGB color space of the monitor. Ideally, you need calibrated information about the color properties of the monitor in order to do this. Note that RGB systems only approximate the nonlinear perceptual response humans have to brightness, so you want to compensate for this, and this is a tricky task. So far, so good. However, not even the GIMP implements this, and you need a special plug-in for Adobe Photoshop to get it there. And actually, even if you calibrate according to the properties of the original color space of the image, and the same for the monitor, you would actually also have to calibrate according to the light around the monitor! And ideally, you also have to calibrate according to your printer, and the light in which the print is to be seen. In general, a complete color-proof system is very expensive and difficult to achieve. So, while not perfect, I agree with Mike that (either of) his weighted-average formula is much better than the crude average I presented. And the effort in making it even better is certainly not worth it, nor practical. Greets, Asger