OpenEXR (.exr)
Background & Context
-
- Registered MIME type: image/x-exr
- OpenEXR raster image format.
- Used in digital image manipulation for theatrical film production.
- EXR is an acronym for Extended Dynamic Range.
- Binary file format.
- Stores 16 bit per pixel IEEE HALF-precision floating-point color channels.
- Can optionally store 32-bit IEEE floating-point "Z" channel depth-buffer components, surface normal directions, or motion vectors.
- Can store multiple images using either tiled or multi-view scanline modes.
- Supports alpha channels.
- Introduced in 2003 by Industrial Light and Magic.
- OpenEXR is a project of the Academy Software Foundation.
Import
- Import["file.exr"] imports an OpenEXR file as a single Image.
- Import["file.exr",elem] imports the specified element from an OpenEXR file.
- The import format can be specified with Import["file","OpenEXR"] or Import["file",{"OpenEXR",elem,…}].
- Export["file.exr",expr] exports expr to OpenEXR.
- The following expressions are supported:
-
image an Image object graphics a Graphics or Graphics3D object, rasterized {expr1,expr2,…} a list of different images, also known as views <"name1"expr1,… > a list of named images - When exporting graphics, the resulting image has the same raster size as its displayed form.
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Data representation elements:
-
"Image" first image returned as an Image object "Graphics" first image returned as a Graphics object "EmbeddedThumbnail" thumbnail stored in the file, if available "Thumbnail" thumbnail of the first image - Import by default uses the "Image" element.
- OpenEXR may store multiple images known as views. Images typically represent multiple resolutions or various depth levels of the same image.
- Properties of files containing multiple views:
-
"ImageCount" number of images in the file "ImageNames" names of images stored in the file "ImageMode" mode of the OpenEXR image "ImageSizeRoundingMode" rounding mode used in tiled images when downsampling - Possible image modes are:
-
"Scanline" single image "OneLevel" single level "Mipmap" mipmap tiling "Ripmap" ripmap tiling "Deep" stores multiple depth levels - Elements returning multiple views:
-
"Data" arrays of numeric values "GraphicsList" data returned as Graphics objects "ImageList" data returned as Image objects - Elements returning multiple views give an association in the form <name1view1,… >, where the structure of viewi depends on level mode and whether the file stores a deep image.
- The structure of the result for each image viewi depending on the image mode is:
-
"Scanline" res "OneLevel" <1res1 > "Mipmap" <1res11,2res22,… > "Ripmap" <1<1res11,2res21,… >,2<1res12,2res22,… >,… > "Deep" <1deep1,2deep2,… > - Where every resij is downsampled in the dimension by a factor of i and in the dimension by a factor of j.
- Separate channel representation elements:
-
"ChannelNames" name of color channels in each view "Channels" the number of color channels used in each view "ChannelData" channel data for each view "ChannelImageList" list of channel images for each view - Channels are automatically combined for some known color spaces (e.g. combining "R", "G" and "B" channels into an RGB image, etc.).
- Metadata elements for each view:
-
"BitDepth" number of bits used to encode a color channel in the file "ColorSpace" color encoding used in the file "ImageSize" raster dimensions "LevelCount" number of levels per view - Metadata elements for the whole file:
-
"Attributes" list of all attributes stored in the OpenEXR file "Author" creator name "Comments" user comments "Compression" how images are compressed in the file "CopyrightNotice" copyright information as a string "DataWindow" coordinates of the corners of the data window "DateTime" file creation date and time "DisplayWindow" coordinates of the corners of the display window "Summary" summary of the file "SummarySlideView" slide view summary of all views "Version" version of the OpenEXR file - Subelements for partial data import for elements such as "Data", "ImageList" and "ChannelImageList" can be specified. Depending on the mode of the OpenEXR file, partial access can be specified in one of the following forms:
-
"Scanline" {elem,view,channel} "OneLevel" {elem,view,level,channel} "Mipmap" {elem,view,level,channel} "Ripmap" {elem,view,level,level,channel} "Deep" {elem,view,level,channel} - The data representation elements are imported from the data window.
Options
- Import options:
-
ImageSize Automatic overall image size "ImageTopOrientation" Automatic orientation of the image as stored in the file - Export options:
-
"Attributes" Automatic attributes associated to the file "ImageMode" Automatic mode of the OpenEXR image "ImageSizeRoundingMode" "Up" rounding mode used in tiled images when downsampling "EmbeddedThumbnail" None thumbnail to be embedded into the file
Examples
open allclose allBasic Examples (3)
Scope (3)
Import Elements (31)
Data Representation (13)
"ChannelData" (2)
"ChannelImageList" (2)
"Data" (2)
"Graphics" (1)
Import the first image as a Graphics object: