Hi guys, just looking for some pointers/help here.

I have a 32-bit floating point lat/long EXR file on disk, and I want to convert it to a tiled & mipampped16-bit (half) file via code.

So, I create a new image spec setting just the following:

ImageSpec cFinalImageSpec;
cFinalImageSpec.attribute ("maketx:fileformatname", "exr");
cFinalImageSpec.format = TypeDesc::HALF;
cFinalImageSpec.attribute ("maketx:nomipmap", false);

Then I call:

ImageBufAlgo::make_texture(ImageBufAlgo::MakeTxEnvLatl, fileIn, fileOut, cFinalImageSpec);

This generates a file OK, but if I load it with IV, it comes out looking quite corrupt (from the point of view that the pixel colours look wrong, but the general "shape" of the image is correct). If I bring up the image information in IV, it states that it's a float format, which it should not.

Interestingly, if I load it into IrfanView, it all looks fine (as does the preview of them both on my Mac).

Any suggestions? It's driving me nuts trying to work out why IV seems to think it's a floating point format, yet it should have been written out as a half format.
Perhaps I should not be using ImageBufAlgo::make_texture to convert …
I have build OpenEXR (including the IV viewer etc) from source here (based on 2.1) - I did wonder if something has not quite gone right in the compilation.
I'm running this under Windows too.

I have attached a before/after exr image - it's a 200x100 black image, with a small green circle in the middle as a test.
The before is a 32-bit float, scan line image.
The after is a 16-bit half, tiled image.

Best Regards,
   Simon

_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to