[Numpy-discussion] display numpy array as image
Thu Nov 29 17:13:58 CST 2007
On Nov 29, 2007 2:32 PM, Zachary Pincus <email@example.com> wrote:
> Hello all,
> I'm curious if people have experience with / preferences for how to
> display a numpy array onscreen as an image.
> Pyglet looks relatively easy -- you can feed an image buffer object
> with a string or a ctypes pointer. I presume getting a string from an
> array is plenty fast, but the ctypes pointer option is intriguing as
> it allows for dealing with simple strided arrays (the image objects
> allow for an arbitrary number of bytes between rows). Is it possible
> to get a ctypes pointer to the beginning of the array buffer from
> numpy without too much ugliness?
> wxPython looks pretty easy too, as there are facilities for getting
> pixels from a buffer. Does anyone have any experience with these? Are
> there ways of allowing a numpy array and a wxPython image to point to
> the same memory?
> Anyhow, these are specific questions, but I'd also appreciate any
> general thoughts about good approaches for getting pixels from numpy
> arrays onscreen.
> Numpy-discussion mailing list
Have you tried the matplotlib/pylab module? It has pretty simple ways
of doing what you're thinking of if I'm understanding your intent
More information about the Numpy-discussion