Posted by C. on 07/04/06 11:31
julian_m wrote:
> Do anyone know an algorithm which retieves a grey value given certain
> rgb value?
>
> I'm needing this kind of function:
>
> $grey = RGBtoGrey('#ffffff');
<snip>
> (.3*Red) + (.59*Green) + (.11*Blue)= Luminance/brightness
>
> I'm just wondering whether someone here has better ideas...
Although it might need some gamma correction, I would have thought that
the best starting point would be the size of the RGB vector - i.e.
grey = (255/442) * sqrt(red*red + green*green + blue*blue)
You tell us what looks better.
C.
Navigation:
[Reply to this message]
|