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

Preserve OpenEXR dataWindow and displayWindow when converting cropped GPU renders into image tensors and annotations in a full-frame coordinate system.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-openexr-data-display-window-canvas/
Language: en

## 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](https://openexr.com/en/latest/TechnicalIntroduction.html) 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](https://openexr.com/en/latest/python.html) 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](https://mitsuba.readthedocs.io/en/latest/src/generated/plugins_films.html) 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](/journal/data-guide-image-exif-box-coordinate/) and [COCO annotation identity](/journal/data-guide-coco-instance-caption-identities/) 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.
