Crop and scale

Write only the rectangle x=100, y=100, width=1000, height=800, and multiply pixel values by headroom * scale. These examples set headroom to 12 and scale to 1, so the factor is 12. The default headroom is 6; doubling it adds one stop.

Hard crop drops pixels outside the rectangle. Soft crop would keep the full sensor and record the rectangle as the display window. off writes the full sensor and ignores the crop box. The origin and size are in the decoded image. A zero crop box means the default crop, which should match the in-camera JPEG. This example sets a non-zero box, so that default is not used.

The output is <stem>_aces.exr beside the input. A failed call sets status and last_error_message and does not write the file.

rawtoaces --crop-mode hard --crop-box 100 100 1000 800 \
    --headroom 12 --scale 1 \
    photo.dng

See also convert a single image and the crop options in the user guide.