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.
If filename is a
HEIF or HEIC file containing more than one image, then info
returns a structure whose fields contain information about the primary image in
the graphics file. (since R2025a)
Examples
Input Arguments
Output Arguments
Tips
For JPEG, TIFF, HEIF, and HEIC (since R2025a) files, the
infostructure can include anOrientationfield that contains the value of the ExifOrientationtag from the image file.This table shows how the
imreadfunction uses the value of the ExifOrientationtag to transform the image data when theAutoOrientname-value argument istrue.Value of OrientationFieldDescription of Transformation 1No transformation 2Reflect about vertical axis 3Rotate 180° 4Reflect about vertical axis and then rotate 180° 5Reflect about vertical axis and then rotate 90° counterclockwise 6Rotate 90° clockwise 7Reflect about vertical axis and then rotate 90° clockwise 8Rotate 90° counterclockwise (since R2024b)
For Adobe DNG files, the
imfinfofunction returns the image dimensions of the preview image in theHeightandWidthfields of theinfostructure.For BMP files, the
infostructure can contain a negativeHeightvalue. 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 theHeightvalue.