PyQt, exr and tga

Hi,

Still new to python/PyQt, I’m developing an app that will show into its Qt GUI some exr and tga files. Problem is that jpg and png works like a charm natively into pyqt, but how can I make pyqt read and show exr and tga files ? Would be even better to show some gamma1 exr with gamma2.2 into the gui, and such sort of thing.
Thks
Kib

Since neither QT nor the Python standard library support EXR or TGA, you’ll need to use some additional libraries. PIL can read TGA files (along with most other common formats), and you’ll need to use OpenEXR to read EXRs. Once you have straight-up RGB bitmap data for those images, you can use it to construct a new QImage, which you could presumably use to create a QPixmap for display in a UI.

You can get precompiled binaries of PIL and OpenEXR here.

You can also use OpenImageIO, it support both TGA and OpenEXR formats. But you may have to compile the binaries, I could not find precompiled binaries on the site.

Also also OpenCV.