--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, certainly this is round to nearest for the luminance computation, and that is a good thing.
As far as the equation itself, this is a color science topic with many types of answers—engineering answers that cite various specifications, scientific answers that study human perception, and others. The logic of it is that the typical human eye is much more sensitive to green light, then reds, and then blue least of all. Basically this is just 6x, 3x and 1x the sensitivity.
However, the color responses in the eye are spectral—across a range of frequencies—not centered at just the one particular red, green, and blue wavelength of a particular display device, which is why there are so many engineering answers—one overall best fit per color triad for the original NTSC phosphor colors, for CRT computer monitors, etc.
That said, NONE OF THEM ARE VERY GOOD for common purposes.
Here is a survey:
http://cseweb.ucsd.edu/~ckanan/publications/Kanan_Cottrell_PloS_ONE_2012.pdf
And interesting approaches…
http://www.cs.northwestern.edu/~ago820/color2gray/color2gray.pdf
https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-649.pdf
What I tend to use is the perceptually pleasing, unofficial, non-standard, clever solution by Darel Rex Finley…
y := math.Sqrt(0 .299*r*r + 0.587*g*g + 0.114*b*b)
You can see how well it works by looking at the child and building images on his web page. See how long it takes you to see what’s happening in the bottom row…
Michael
--
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
gift [3]:y := 0.299*px.R + 0.587*px.G + 0.114*px.B
I did not understand why image/color adds an extra 0.5 (500/1000) to y.Could anybody give me a clue?