pthom / imgui_bundle

Dear ImGui Bundle: an extensive set of Ready-to-use widgets and libraries, based on ImGui. Start your first app in 5 lines of code, or less. Whether you prefer Python or C++, this pack has your back!
https://pthom.github.io/imgui_bundle/
MIT License
616 stars 64 forks source link

Displaying images stored in numpy arrays #235

Closed mafried closed 2 weeks ago

mafried commented 3 weeks 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 2 weeks 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 2 weeks ago

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