Information about graphics file
The format of the file is inferred from its contents.
filename is a TIFF, PGM, PBM, PPM, HDF, ICO,
GIF, SVS, or CUR file containing more than one image, then
info is a structure array with one element for
each image in the file. For example,
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 or string scalar.
Depending on the location of the file,
take on one of these forms.
|Current folder or folder on the MATLAB path|
Specify the name of the file in
File in a folder
If the file is not in the current folder or in a folder on the MATLAB path, then specify the full or relative path name.
If the file is located by an internet URL, then
If the file is stored at a remote location,
Based on your remote location,
For more information, see Work with Remote Data.
fmt— Image format
Image format, specified as a character vector or string scalar. The possible values for
fmt are contained in the MATLAB file format registry. To view of list of these formats, run
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.