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

Re: [pygame] image.load() -->> array?



On Oct 25, 2007, at 9:56 AM, Ian Mallett wrote:

On a not unrelated note, I've been trying to make a 3D map viewer that
loads height values from a black/grey/white image.  I've been making
it a surface, and using surface.get_at() for each pixel.  I think
surfarray should do it better, though I've never used it.

surface.get_at() can be kinda slow, and typically sequence item access is faster in python then a function call anyway.

Regardless, I wouldn't worry about it unless it helps makes the code simpler or profiling shows you that using get_at() is slowing you down too much.

-Casey