brightness Algorithm

As specify by the US Federal Glossary of telecommunication terms (FS-1037C)," brightness" should now be used only for non-quantitative references to physiological sensations and perceptions of light. A given target luminance can elicit different perceptions of brightness in different contexts; see, for example, white's illusion.

brightness source code, pseudocode and analysis