Read metadata from EXR file
Read Metadata from EXR File
Read metadata from an EXR file.
info = exrinfo("office.exr");
Examine information about the channels stored in the EXR file. The image contains the four channels
A, which indicates an RGB image with an alpha channel. The pixel values are stored as half-precision values.
ans=4×3 table PixelType XSubSampling YSubSampling _________ ____________ ____________ A "half" 1 1 B "half" 1 1 G "half" 1 1 R "half" 1 1
Access values for optional EXR metadata attributes. If the EXR metadata does not specify a value for an attribute, the structure returns that attribute as an empty field.
ans = struct with fields: AdoptedNeutral:  Altitude: 181 Aperture:  CameraFocalLength:  CaptureDate: "" Chromaticities: [0x0 table] Comments: "Sample EXR Image provided by The MathWorks, Inc. (www.mathworks.com)" DWACompressionLevel:  EnvironmentMap: "" ExposureTime:  FramesPerSecond:  ISOSpeed:  Latitude: 42.3015 Longitude: -71.3761 LookModTransform: "" OriginalDataWindow:  Owner: "Copyright 2022 The MathWorks, Inc." PixelsPerInchAlongRow:  RenderingTransform: "" UTCOffset:  WhiteLuminance:  WorldToCamera:  WorldToNDC:  WrapModes: ""
filename — Name of EXR file
character vector | string scalar
Name of the EXR file, specified as a character vector or string scalar.
filename can contain the absolute path to the file, a relative
path from the current directory, or a relative path from a directory on the MATLAB® path. The file must be a valid EXR file for which the
info — Information about EXR metadata
P-by-1 structure array
Information about the EXR metadata, returned as a P-by-1 structure array containing information about each of the P parts of the EXR file. The output structure contains these fields:
|File name, including the absolute path and file extension, returned as a string scalar.|
|Part name, returned as a string scalar. If the image part does not have a
name, then the function returns |
|Part type, returned as |
Size of the display window, returned as a 4-element vector of
integers, of data type
The origin of the pixel coordinate system is (0, 0). The coordinate values can be positive or negative integers.
Extents of the data window, returned as a 4-element vector of
integers, of data type
The data window specifies the size and location of the image data stored in the file part. The origin of the pixel coordinate system is (0, 0). The coordinate values can be positive or negative integers. The data window can be smaller or larger than the display window.
Order in which the file part stores image data scanlines or tiles, returned as one of these values:
|Names of the views stored in the file part, returned as an
m-by-1 string array, where m is the
number of views in the file part. If the file part does not contain any view
information, then the function returns |
Channel information, returned as a c-by-3 table, where c is the number of image channels in the file part. The name of each row is the name of the corresponding channel. The table has these columns:
Compression mode used to store the image data, returned as
|Width of the screen window, returned as a scalar of data type
|xy-coordinates of the screen window center, in pixels,
returned as a two-element vector, of data type |
|Ratio of the image width to the image height, returned as a scalar of
data type |
|Structure that contains optional attributes the EXR format supports. See the Attributes in AttributeInfo table for details.|
Information about image tiles, returned as a structure with these fields:
If the file part is a scanline image, then the function
Image part contains deep image data, returned as a logical
MATLAB does not support reading or writing deep image data from EXR files.
This table describes the
AttributeInfo structure returned in
info. The table lists the
names, the corresponding attribute names in the EXR specification, and the expected data
type of the attribute. If the EXR file does not specify a value for an attribute, or the
value is not in the expected data type, then
exrinfo returns the
attribute as an empty field. For more details about the meaning of these optional
attributes, see the OpenEXR Documentation on Standard Optional Attributes.
|Name in ||Name in EXR Specification||Expected Value|
exrinfo function does not support reading these standard
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Introduced in R2022b