Page 1 of 1

Exr images with data window don't get rendered properly

Posted: 2014-01-09T06:09:27-07:00
by shibata
Hi,
I've been playing around a bit with the exr libraries and tried creating an exr file with a data window < display window (the area with data is smaller than the image resolution). Using the sample code provided in the docs to read the image and saving it with:

Code: Select all

void writeRgba2 (const char fileName[], const Rgba *pixels, int width, int height, const Box2i &dataWindow) {
    Box2i displayWindow (V2i (0, 0), V2i (width - 1, height - 1));
    RgbaOutputFile file (fileName, displayWindow, dataWindow, WRITE_RGBA);
    file.setFrameBuffer (pixels, 1, width);
    file.writePixels (dataWindow.max.y - dataWindow.min.y + 1);
}
The generated image has a smaller data window and is displayed correctly with exrdisplay:

Original image
Image

Generated image
Image

But imagemagick stretches the end of the data window until the end of the image:
Image

The problem persists after converting the image to other formats (eg. convert test.exr test.png).

Re: Exr images with data window don't get rendered properly

Posted: 2014-01-09T11:43:12-07:00
by fmw42
Are you using 32-bit EXR images or "half format" 16-bit EXR images. IM only supports the latter.

Re: Exr images with data window don't get rendered properly

Posted: 2014-01-24T17:38:35-07:00
by shibata
I was using 32-bit floats, but the issue happens with 16-bit halfs, too.

Re: Exr images with data window don't get rendered properly

Posted: 2014-01-24T19:11:46-07:00
by fmw42
Looks like a -virtual-pixel edge effect. Try setting virtual-pixel to black or transparent and see how it looks.

Re: Exr images with data window don't get rendered properly

Posted: 2014-01-26T11:05:16-07:00
by shibata
Looks the same :(