PDA

View Full Version : Converting Numpy Array to wx.Image Object



cmat
February 22nd, 2010, 04:48 AM
Hello, I've been having some difficulty with loading an image in wxPython. I would like to display an image contained in a 2D numpy array. I keep getting an error regarding the buffer size being incorrect. It works fine when loading a 24-bit colour image stored in a numpy array but not an 8-bit grayscale.

Is there a proper way of doing this? Any help will be greatly appreciated. Also I do not want to use any libraries other than Numpy and Wx. I need to keep dependencies to a minimum.

Thanks, cmat