imageimage-processingcolorsrgbvideo-processing

Formula to determine perceived brightness of RGB color


I'm looking for some kind of formula or algorithm to determine the brightness of a color given the RGB values. I know it can't be as simple as adding the RGB values together and having higher sums be brighter, but I'm kind of at a loss as to where to start.


Solution

  • The method could vary depending on your needs. Here are 3 ways to calculate Luminance:

    [Edit: added examples using named css colors sorted with each method.]