read_exr: Read an OpenEXR image

View source: R/read_write_exr.R

read_exrR Documentation

Read an OpenEXR image

Description

Load an RGBA OpenEXR image into R numeric matrices.

Usage

read_exr(path, array = FALSE)

Arguments

path

Character scalar. Path to an '.exr' file.

array

Default 'FALSE'. Return a 4-layer RGBA array instead of a list.

Value

A list with elements 'r', 'g', 'b', 'a' (numeric matrices), and the integer dimensions 'width', 'height'.

Examples

#Write the included data to an EXR file
tmpfile = tempfile(fileext = ".exr")
write_exr(tmpfile,
          widecolorgamut[,,1],
          widecolorgamut[,,2],
          widecolorgamut[,,3],
          widecolorgamut[,,4])
exr_file = read_exr(tmpfile)
str(exr_file)

libopenexr documentation built on Aug. 8, 2025, 6:44 p.m.