You are here: Re: rgb to grayscale « PHP Programming Language « IT news, forums, messages
Re: rgb to grayscale

Posted by lorento on 07/04/06 11:18

Found some code:

$grey= 0.2125*$rgb['red']+ 0.7154*$rgb['green']+ 0.0721*$rgb['blue'];

--
http://blog.deshot.com
http://www.immersivelounge.com

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');
>
> where $grey (function's return value) should be a real number in [0;1]
> range
>
> Googling a little bit, I found an equation which seems to be aplied by
> many photo-editor software
>
> (.3*Red) + (.59*Green) + (.11*Blue)= Luminance/brightness
>
> I'm just wondering whether someone here has better ideas...
>
> regards - julian

 

Navigation:

[Reply to this 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

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