imfinfo
Information about graphics file
Description
returns a structure whose fields contain information about the image in the
specified graphics file. The format of the file is inferred from its
contents.info
= imfinfo(filename
)
If filename
is a CUR, GIF, HDF4, ICO, PBM, PGM, PPM, SVS,
or TIFF file containing more than one image, then info
is a
structure array with one element for each image in the file. For example,
info(3)
would contain information about the third image
in the file.
Examples
Input Arguments
Output Arguments
Tips
For JPEG and TIFF files, the
info
structure can include anOrientation
field that contains the value of the ExifOrientation
tag from the image file.This table shows how the
imread
function uses the value of the ExifOrientation
tag to transform the image data when theAutoOrient
name-value argument istrue
.Value of Orientation
FieldDescription of Transformation 1
No transformation 2
Reflect about vertical axis 3
Rotate 180° 4
Reflect about vertical axis and then rotate 180° 5
Reflect about vertical axis and then rotate 90° counterclockwise 6
Rotate 90° clockwise 7
Reflect about vertical axis and then rotate 90° clockwise 8
Rotate 90° counterclockwise (since R2024b)
For Adobe DNG files, the
imfinfo
function returns the image dimensions of the preview image in theHeight
andWidth
fields of theinfo
structure.For BMP files, the
info
structure can contain a negativeHeight
value. The negative value indicates that the origin of the image is in its upper-left corner. In such cases, the actual height of the image in pixels is the absolute value of theHeight
value.