exrinfo
Syntax
Description
Examples
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 R
, G
, B
, and A
, which indicates an RGB image with an alpha channel. The pixel values are stored as half-precision values.
info.ChannelInfo
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.
info.AttributeInfo
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: ""
Input Arguments
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 isexr
function returns true
.
Data Types: char
| string
Output Arguments
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:
Field | Description |
---|---|
FileName | File name, including the absolute path and file extension, returned as a string scalar. |
PartName | Part name, returned as a string scalar. If the image part does not have a
name, then the function returns PartName as
"" . |
PartType | Part type, returned as "Scanline" or
"Tiled" . |
DisplayWindow | 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. |
DataWindow | 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. |
LineOrder | Order in which the file part stores image data scanlines or tiles, returned as one of these values:
|
Views | 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 Views as
"" . |
ChannelInfo | 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 | Compression mode used to store the image data, returned as
|
ScreenWindowWidth | Width of the screen window, returned as a scalar of data type
double . |
ScreenWindowCenter | xy-coordinates of the screen window center, in pixels,
returned as a two-element vector, of data type double , of
the form [x y] . |
PixelAspectRatio | Ratio of the image width to the image height, returned as a scalar of
data type double . |
AttributeInfo | Structure that contains optional attributes the EXR format supports. See the Attributes in AttributeInfo table for details. |
TileInfo | Information about image tiles, returned as a structure with these fields:
If the file part is a scanline image, then the function
returns |
IsDeepData | Image part contains deep image data, returned as a logical
Note 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 AttributeInfo
field
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 Attributes.
Attributes in AttributeInfo
Name in AttributeInfo
| Name in EXR Specification | Expected Value |
---|---|---|
AdoptedNeutral | adoptedNeutral | 2-element double vector |
Altitude | altitude | double scalar |
Aperture | aperture | double scalar |
CameraFocalLength | focus | double scalar |
CaptureDate | capDate | string scalar |
Chromaticities | chromaticities | 4-by-2 table |
Comments | comments | string scalar |
DWACompressionLevel | dwaCompressionLevel | double scalar |
EnvironmentMap | envMap | "LatLon" or "Cube" |
ExposureTime | expTime | double scalar |
FramesPerSecond | framesPerSecond | double scalar |
ISOSpeed | isoSpeed | double scalar |
Latitude | latitude | double scalar |
Longitude | longitude | double scalar |
LookModTransform | lookModTransform | string scalar |
OriginalDataWindow | originalDataWindow | 4-element double vector of integers |
Owner | owner | string scalar |
PixelsPerInchAlongRow | xDensity | double scalar |
RenderingTransform | renderingTransform | string scalar |
UTCOffset | utcOffset | double scalar |
WhiteLuminance | whiteLuminance | double scalar |
WorldToCamera | worldToCamera | 4-by-4 double matrix |
WorldToNDC | worldToNDC | 4-by-4 double matrix |
WrapModes | wrapmodes | string scalar |
The exrinfo
function does not support reading these standard
optional attributes: keyCode
, timeCode
,
deepImageState
, ID Manifest
.
Extended Capabilities
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced in R2022b
See Also
isexr
| exrread
| exrwrite
| exrHalfAsSingle
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)