Search code examples
pythonnumpywxpython

Python GUI library to show 16bit greyscale image


guys,

I am trying to find a python GUI library that can show and process 16bit greyscale image easily. I need to modify pixels. I have tried wxpython. It can show the images. But when I tried to convert a numpy array with single channel 16bit data to a string and loaded it in wxImage, it showed me that invalid buffer size. What's more, I have tried to decode the first element of data string in a wxImage instance that load the same image directly. Its value wasn't equal to the pixel (0,0) in numpy array. Could someone tell me how wxPython format its data string or introduce a better GUI library that can fix this? I know wxImage normally formats its pixel data with RGB. But I just need grey image. And I need to create a sophisticated UI. I think opencv can't meet my need.


Solution

  • You can use pyqt or pyside, but I would recommend pyqtgraph which is excellent for this sort of thing. You can build your ui in pyside and use pyqtgraph to manage image output