Learn R Programming

libopenexr (version 3.4.0-5)

read_exr: Read an OpenEXR image

Description

Load an RGBA OpenEXR image into R numeric matrices.

Usage

read_exr(path, array = FALSE)

Value

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

Arguments

path

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

array

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

Examples

Run this code
#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)

Run the code above in your browser using DataLab