pthom / imgui_bundle

Your fast track to powerful GUIs: Dear ImGui Bundle, an extensive toolkit for Python and C++ with immediate mode efficiency.
https://pthom.github.io/imgui_bundle/
MIT License
703 stars 73 forks source link

Displaying images stored in numpy arrays #235

Closed mafried closed 4 months ago

mafried commented 4 months ago

Hi,

I would like to display images stored in numpy arrays (I'm using the python bindings of imgui_bundle). I'm using imgui.image(...) for that but I don't know how to transform the numpy array into a texture. I've used PyImGUI in the past together with the moderngl package where texture creation from numpy arrays is simple. Since PyImGUI seems not to be maintained anymore, I switched to imgui_bundle.

Now, I tried the same thing with imgui_bundle and immapp but could not find anything helpful.

Thank you!

Best regards

pthom commented 4 months ago

Hello,

Just try immvision.image_display or immvision.image

https://github.com/pthom/imgui_bundle/assets/7694091/47209271-0de6-4ba4-bd96-9346e8f5d606

mafried commented 4 months ago

Hi, Thank you so much for your quick and thorough reply! I'm using the immvision image widget and it's working great.