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

Re: [pygame] Re: PixelArray versus Surfarray + Numeric/NumPy



On, Mon Jan 05, 2009, Jordan Applewhite wrote:

> Hello again.  I may have posted prematurely.  It seems that the easiest
> thing for me to do is to just set up a Python2.4 + Numeric dev environment
> and wait for the incompatibilities to sort themselves out.  I still welcome
> any of your suggestions too my previous questions.

[...]

Numpy and Numeric have several differences, but are - in their overall
structure - similar. As you might have read, they support 3D access
(R,G,B). In contrast to them, PixelArray supports only 2D access using
the integer RGBA representation.

if 2D access is enough for you, PixelArray should work well in 90
percent of all cases. It is optimised for the direct surface access, so
that no performance loss through a 3rd party library is given.

(Complex) Mathematical operations and manipulation however might perform
better using Numpy and Numeric, especially in conjunction with the
lapack/atlas (a highly efficient math library) bindings of Numpy.

A better advice could be given, if you tell us your individual needs for
the pixel operations you have to do.

Regards
Marcus

Attachment: pgpyAjsQuNW7U.pgp
Description: PGP signature