Information about graphics file
info = imfinfo(filename)
info = imfinfo(filename,fmt)
info = imfinfo(URL)
The format of the file is inferred from its contents.
filename is a TIFF, HDF, ICO,
GIF, or CUR file containing more than one image, then
a structure array with one element for each image in the file. For
info(3) would contain information about
the third image in the file.
Find information about the example image,
info = imfinfo('ngc6543a.jpg');
info structure contains the following information fields:
To display information from the structure, for example
info.CodingMethod in the command window.
ans = Huffman
To display all the properties in the structure, type
info in the command window.
filename— Name of graphics file
Name of graphics file, specified as a character vector.
fmt— Image format
Image format, specified as a character vector. The possible
fmt are contained in the MATLAB file
format registry. To view of list of these formats, run the
URL— Image location
Image location, specified as a character vector.
include the protocol type (e.g.,
info— Information about graphics file
Information about the graphics file, returned as a structure
array. The set of fields in
info depends on the
individual file and its format. This table lists the nine fields that
always appear, and describes their values.
Name of the file or the internet URL specified. If the file is not in the current folder, the character vector contains the full path name of the file.
Date when the file was last modified.
Size of the file, in bytes.
File format, as specified by
File format version.
|character vector or number|
Image width, in pixels.
Image height, in pixels.
Number of bits per pixel.
Additional fields returned by some file formats:
JPEG and TIFF only — If
Exchangeable Image File Format (EXIF) tags, then
positioning system information) fields.
GIF only —
the value of the
'DelayTime' field in hundredths
JPEG2000 only — The
contains an m-by-3 cell array,
The first column of
a channel position as it exists in the file. The second column reports
the type of channel, and the third column reports the channel mapping.