Color->Greyscale

This is a discussion on Color->Greyscale within the A Brief History of Cprogramming.com forums, part of the Community Boards category; How would you determine from the RGB values the lightness of a pixel?...

  1. #1
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718

    Color->Greyscale

    How would you determine from the RGB values the lightness of a pixel?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  2. #2
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    By using this formula (assuming you have an RGB to work with)

    Luminance == (RED * 0.3) + (GREEN * 0.59) + (BLUE * 0.11)

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21