TECHNOLOGY

OpenEXR crop windows: map a local pixel array back to the full render canvas

In this article
THE QUICK TAKE

The pixel array starts locally even when its OpenEXR data window has a nonzero origin on the full image canvas.

Separate the canvas from the stored pixels

A region render can contain the right object but appear misplaced when joined with full-frame labels. OpenEXR distinguishes the display window, which describes the intended image canvas, from the data window, which describes the available pixel region. The format introduction allows the data region to be smaller than the canvas or extend beyond it for overscan. Image dimensions alone cannot reconstruct that relationship.

Read the origin with the array shape

The Python module documentation states that channel arrays match the data-window size and are not offset by its minimum coordinate. A local array index therefore needs the data-window origin when translated into file coordinates. Keep horizontal and vertical axes distinct: a conventional image array indexes rows before columns, whereas a window coordinate identifies horizontal and vertical position. Losing the origin can silently shift every associated annotation.

Respect inclusive bounds

Window maxima identify included pixels. Consequently, width = xmax - xmin + 1 and height = ymax - ymin + 1. Preserve the signed origin; an overscan region can extend outside the usual display area. Decide whether the downstream tensor should contain the stored region or the entire display canvas. If expanding into a larger canvas, make the rule for unavailable pixels explicit rather than treating missing samples as measured black radiance.

Verify the actual output file

Renderer crop controls and file-coordinate metadata are related, but they are not interchangeable evidence. The Mitsuba film reference describes film dimensions and crop settings. Inspect the written file after rendering and after any conversion stage: an intermediate tool may normalize the origin or change the represented canvas. Record each such transformation with the dataset release rather than inferring it later from a scene setting.

Check annotations in a shared coordinate space

Overlay a known landmark and its label using both local and full-canvas coordinates. Repeat with a crop away from the image origin and with an overscan example. Apply the same spatial transformation to boxes, masks and camera-derived projections where relevant. The guides to image orientation and COCO annotation identity address adjacent boundaries. This particular failure occurs when a correctly decoded image is attached to the wrong canvas position, not because the renderer failed to produce pixels.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles