I have several wxPython applications working which display pixel data from a camera. I have to convert the data to greyscale and then create/display the data via wx.BitmapFromBuffer and dc.DrawBitmap. I was curious if there was a quick way to keep that data so it can be displayed in color, similar to what it would look like if I displayed it in iPython with imshow? I believe I have to manually mask bits and populate the RGB array accordingly but I thought I would see if anyone has a better way of doing it.
I have several wxPython applications working which display pixel data from a camera. I have to convert the data to greyscale and then create/display the data via wx.BitmapFromBuffer and dc.DrawBitmap. I was curious if there was a quick way to keep that data so it can be displayed in color, similar to what it would look like if I displayed it in iPython with imshow? I believe I have to manually mask bits and populate the RGB array accordingly
this is quite easy to do with numpy. See notes from me in the past few weeks about similar topics.
-CHB
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
This is very easy to do with Pil (Python Imaging Library). Every
imaginable file-based image format can very easily be read and then be
converted to each other, which includes floating point format images.
Can you provide a floating point format sample image of any size ?
Ray Pasco
···
On Jun 16, 7:56 pm, Steve <ghostra...@gmail.com> wrote:
Hi All,
I have several wxPython applications working which display pixel data from a
camera. I have to convert the data to greyscale and then create/display the
data via wx.BitmapFromBuffer and dc.DrawBitmap. I was curious if there was a
quick way to keep that data so it can be displayed in color, similar to what
it would look like if I displayed it in iPython with imshow? I believe I
have to manually mask bits and populate the RGB array accordingly but I
thought I would see if anyone has a better way of doing it.
I used PIL to create an image from my data (which I will attach - 66 x 66) and it appears to be in color but looks different than I suspect it should. Perhaps I need a different mode. The code I used was the following: