[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Surfarray Question



hi,

have a look at the Color class.  You can convert between different
color spaces with it.

It depends on the Surface format, for how surfarray gets you that color.

Or if you're looking for intensity... you probably want max(r,g,b)
... there's lots of ways to convert to greyscale... but that works
pretty well.


cheers,


On Fri, Feb 13, 2009 at 3:19 PM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
> Hello,
>
> How are the values in a pygame.surfarray.array2d() array formed?  I would
> like to convert a value from the array into a single channel value in the
> range [0,255].  (Assume 3 channels of equal intensity, so greyscale).
>
> Ian
>