On Mon, Aug 14, 2006 at 11:12:29AM -0700, Christopher Barker wrote: > Another (or additional) option is for both MPL and wx to support the new > array interface protocol in numpy. There's a lot of other reasons to do > that, and, again, Robin has expressed his support for this. If we could > get MPL, wx, numpy, and PIL all passing data around with this protocol, > we'd be in great shape. Travis posted a patch to PIL for support a while > back, I don't know if it's going to get applied or not, but it's worth > looking at.
Looks like it has been added already. From http://effbot.org/zone/pil-changes-116.htm - Added "fromarray" function, which takes an object implementing the NumPy array interface and creates a PIL Image from it. (from Travis Oliphant). - Added NumPy array interface support (__array_interface__) to the Image class (based on code by Travis Oliphant). This allows you to easily convert between PIL image memories and NumPy arrays: import numpy, Image i = Image.open('lena.jpg') a = numpy.asarray(i) # a is readonly i = Image.fromarray(a) Regards Stéfan ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users