in reply to convert image to greyscale (color to black and white)

For obvious reasons this conversion method is called the arithmetic mean method. There is also a geometric mean method (it basically sucks and uses (R*G*B)^1/3 - so if R,G, or B are 0 you get black).

Proportional sum of the colors.

This algorithm is simple but the basis of it is much more complex. The formula looks like:

Y = .30 * R + .59 * G + .11 * B.

The percentages here relate to how perceptive the eye is to a given color.

"The formula used in the GIMP is Y = 0.3R + 0.59G + 0.11B; this result is known as luminance. The weights used to compute luminance are related to the monitor's phosphors. The explanation for these weights is due to the fact that for equal amounts of color the eye is most sensitive to green, then red, and then blue. This means that for equal amounts of green and blue light the green will, nevertheless, seem much brighter. Thus, the image obtained by the normal averaging of an image's three color components produces a grayscale brightness that is not perceptually equivalent to the brightness of the original color image. The weighted sum that defines Y, however, does." - READ FULL TEXT, SEE PRETTY EXAMPLE PICTURES at http://gimp-savvy.com/BOOK/index.html?node54.html

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: convert image to greyscale (color to black and white)
by bart (Canon) on Dec 22, 2003 at 10:33 UTC
    The formula used in the GIMP is Y = 0.3R + 0.59G + 0.11B; this result is known as luminance.
    This formula is not only used in The Gimp, but also in television. In order to make the color signal grokkable by B&W TV sets, a backward compatible signal is used, consisting of this liminance as the main signal, which means it is what you get to see on B&W sets; plus two extra color difference signals modulated on top of that.

    From what I gather, both NTSC (USA) and PAL (Europe) use the same mechanism.

    Common abbreviations in literature are YUV and YCrCb — "Y" is the lumninance signal, U and V resp. Cr/CB are the two other, "chroma", signals . Look here for an intro, for example.