Re: How To Compare Colors?
- From: "Jason Doucette" <www.jasondoucette.com>
- Date: Mon, 30 May 2005 12:26:31 -0300
"cppaddict" <hello@xxxxxxxxx> wrote in message
news:1o8a919porad17fbkf7tk7pv9sanp0rk1g@xxxxxxxxxx
>I realized that a perhaps clearer explanation of what I want is:
>
> 1. First convert the 2 colors to greyscale.
> 2. Now compare how black they are.
Compute the luminosity of both colors (i.e. get a 'brightness' value from
0.0..1.0), then compare the two values.
There are different standards for the luminosity calculation. It is really
up to you which one to use:
Y = 0.299*Red + 0.587*Green + 0.114*Blue (most commonly used)
Y = 0.213*Red + 0.715*Green + 0.072*Blue
Y = 0.222*Red + 0.707*Green + 0.071*Blue (latest ITU recommendation)
( all from http://lists.gnu.org/archive/html/groff/2001-10/msg00181.html )
--
Jason Doucette
http://www.jasondoucette.com/
http://www.sawtoothdistortion.com/
.
- References:
- How To Compare Colors?
- From: cppaddict
- Re: How To Compare Colors?
- From: cppaddict
- How To Compare Colors?
- Prev by Date: Re: VC++.NET equivalent code of C#.NET grayscale code
- Next by Date: Re: GDI bug?
- Previous by thread: Re: How To Compare Colors?
- Next by thread: Re: How To Compare Colors?
- Index(es):