Posted by C. on 03/22/07 14:33
On 21 Mar, 18:27, Lars Erik Bryld <larse...@dadlnet.invalid> wrote:
>
> I am trying to convert a (supposedly) working python script into php.
> The script reads a colour gif-picture and produces a greyscale copy of
> it.
>
<snip>
It would be safer to use GD. There's even an example of how to do this
at http://www.php.net/manual/en/function.imagecolorset.php
(FWIW, both the example above and your own code use an averaging
method to determine the grey scale; while color models vary, it might
be more approriate to measure the size of the orthognal vectors -
(integer)(sqrt($red*$red + $green*$green + $blue*$blue)*0.5769)
)
C.
[Back to original message]
|