Reply to Re: rgb to grayscale

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация