Package 'libopenexr'

Title: Static Library and Headers for 'OpenEXR' Image I/O
Description: Provides the 'OpenEXR' static library and 'C++' headers for high-dynamic-range image I/O (see <https://openexr.com/>) needed to link R packages against the 'OpenEXR' library, along with a basic R interface to load 'EXR' images.
Authors: Tyler Morgan-Wall [aut, cre] (ORCID: <https://orcid.org/0000-0002-3131-3814>), Aaron Demolder [ctb, cph], Abe Fettig [ctb, cph], Aloys Baillet [ctb, cph], Andre Mazzone [ctb, cph], Andrew Kunz [ctb, cph], Anton Dukhovnikov [ctb, cph], Antonio Rojas [ctb, cph], Aras Pranckevičius [ctb, cph], Arkady Shapkin [ctb, cph], Arkell Rasiah [ctb, cph], Axel Waggershauser [ctb, cph], Balázs Oroszi [ctb, cph], Barnaby Robson [ctb, cph], Ben Grimes [ctb, cph], Brendan Bolles [ctb, cph], Cary Phillips [ctb, cph], Chris Leu [ctb, cph], Christina Tempelaar-Lietz [ctb, cph], Christopher Horvath [ctb, cph], Christopher Kulla [ctb, cph], Christoph Gohlke [ctb, cph], Cristian Martínez [ctb, cph], Dan Horák [ctb, cph], Daniel Kaneider [ctb, cph], Darby Johnston [ctb, cph], Dave Sawyer [ctb, cph], David Korczynski [ctb, cph], Diogo Teles Sant'Anna [ctb, cph], Dirk Lemstra [ctb, cph], Drew Hess [ctb, cph], Ed Hanway [ctb, cph], Edward Kmett [ctb, cph], Eric Sommerlade [ctb, cph], E Sommerlade [ctb, cph], Florian Kainz [ctb, cph], Grant Kim [ctb, cph], Gregorio Litenstein [ctb, cph], Gyula Gubacsi [ctb, cph], Halfdan Ingvarsson [ctb, cph], Harry Mallon [ctb, cph], Huibean Luo [ctb, cph], Ibraheem Alhashim [ctb, cph], Jack Kingsman [ctb, cph], Jamie Kenyon [ctb, cph], Jan Tojnar [ctb, cph], Jean-Francois Panisset [ctb, cph], Jens Lindgren [ctb, cph], Ji Hun Yu [ctb, cph], Johannes Vollmer [ctb, cph], John Loy [ctb, cph], John Mertic [ctb, cph], Jonathan Stone [ctb, cph], Jose Luis Cercos-Pita [ctb, cph], Joseph Goldstone [ctb, cph], Juha Reunanen [ctb, cph], Julian Amann [ctb, cph], Juri Abramov [ctb, cph], Karl Hendrikse [ctb, cph], Karl Rasche [ctb, cph], Kevin Wheatley [ctb, cph], Kimball Thurston [ctb, cph], Larry Gritz [ctb, cph], Laurens Voerman [ctb, cph], L. E. Segovia [ctb, cph], Liam Fernandez [ctb, cph], Lucy Wilkes [ctb, cph], Mark Reid [ctb, cph], Mark Sisson [ctb, cph], Martin Aumüller [ctb, cph], Martin Husemann [ctb, cph], Matthäus G. Chajdas [ctb, cph], Matthias C. M. Troffaes [ctb, cph], Matt Pharr [ctb, cph], Md Sadman Chowdhury [ctb, cph], Michael Thomas [ctb, cph], Nicholas Yue [ctb, cph], Nick Porcino [ctb, cph], Nick Rasmussen [ctb, cph], Nicolas Chauvet [ctb, cph], Niklas Hambüchen [ctb, cph], Owen Thompson [ctb, cph], Paul Schneider [ctb, cph], Peter Hillman [ctb, cph], Peter Steneteg [ctb, cph], Peter Urbanec [ctb, cph], Phil Barrett [ctb, cph], Piotr Stanczyk [ctb, cph], Ralph Potter [ctb, cph], Rémi Achard [ctb, cph], Reto Kromer [ctb, cph], Richard Goedeken [ctb, cph], Sergey Fedorov [ctb, cph], Shawn Walker-Salas [ctb, cph], Simon Boorer [ctb, cph], Simon Otter [ctb, cph], Srinath Ravichandran [ctb, cph], Thanh Ha [ctb, cph], Thomas Debesse [ctb, cph], Thorsten Kaufmann [ctb, cph], Timothy Lyanguzov [ctb, cph], Wenzel Jakob [ctb, cph], Wojciech Jarosz [ctb, cph], Xo Wang [ctb, cph], Yaakov Selkowitz [ctb, cph], Yining Karl Li [ctb, cph], Yujie Shu [ctb, cph], Kevin Ushey [cph]
Maintainer: Tyler Morgan-Wall <[email protected]>
License: BSD_3_clause + file LICENSE
Version: 3.4.12-5
Built: 2026-07-03 21:07:41 UTC
Source: https://github.com/tylermorganwall/libopenexr

Help Index


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.

Details

The 'metadata' list contains only metadata present in the file. 'chromaticities' is returned as a named list of 'red', 'green', 'blue', and 'white' xy vectors. 'adoptedNeutral' is returned as an xy vector, 'whiteLuminance' as a scalar, and 'envmap' as '"latlong"' or '"cube"'.

Value

A list with elements 'r', 'g', 'b', 'a' (numeric matrices), the integer dimensions 'width', 'height', and a 'metadata' list. If 'array = TRUE', the metadata list is returned as the 'metadata' attribute.

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)

Wide Color Gamut EXR Data

Description

Wide Color Gamut numeric data in RGBA list format from the OpenEXR project.

Usage

widecolorgamut

Format

An array of four channels (RBGA) and a width/height

Source

<https://openexr.com/en/latest/test_images/TestImages/WideColorGamut.html>


Write an OpenEXR image

Description

Save RGBA numeric matrices to an OpenEXR file (32‑bit float, ZIP compression).

Usage

write_exr(
  path,
  r,
  g,
  b,
  a = matrix(1, nrow = nrow(r), ncol = ncol(r)),
  metadata = NULL
)

Arguments

path

Character scalar output file.

r

Numeric matrix, red channel.

g

Numeric matrix, green channel.

b

Numeric matrix, blue channel.

a

Numeric matrix, alpha channel.

metadata

Default 'NULL'. Optional EXR header metadata list with supported fields 'chromaticities', 'adoptedNeutral', 'whiteLuminance', and 'envmap'.

Details

'metadata$chromaticities' can be a named list with 'red', 'green', 'blue', and 'white' numeric xy vectors, a 4x2 numeric matrix, or a numeric vector of length 8 in red, green, blue, white xy order. 'adoptedNeutral' must be a length-2 numeric xy vector, 'whiteLuminance' must be a numeric scalar, and 'envmap' must be '"latlong"', '"cube"', '0', or '1'.

Value

None.

Examples

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