| MATLAB Function Reference | Search  Help Desk |
| imfinfo | Examples See Also |
Return information about a graphics file
info = imfinfo(filename,fmt) info = imfinfo(filename)
info = imfinfo(filename,fmt) returns a structure whose fields contain information about an image in a graphics file. filename is a string that specifies the name of the graphics file, and fmt is a string that specifies the format of the file. The file must be in the current directory or in a directory on the MATLAB path. If imfinfo cannot find a file named filename, it looks for a file named .fmt.
This table lists the possible values for fmt:info is a structure array with one element (i.e., an individual structure) for each image in the file. For example, info(3) would contain information about the third image in the file.
The set of fields in info depends on the individual file and its format. However, the first seven fields are always the same. This table lists these fields and describes their values:info = imfinfo(filename) attempts to infer the format of the file from its content.
info = imfinfo('flower.bmp')
info =
Filename: 'flower.bmp'
Format: 'bmp'
FormatVersion: 'Version 3 (Microsoft Windows 3.x)'
Width: 227
Height: 149
BitDepth: 8
ColorType: 'indexed'
FormatSignature: 'BM'
NumColormapEntries: 256
Colormap: [256x3 double]
RedMask: []
GreenMask: []
BlueMask: []
FileSize: 35050
ImageDataOffset: 1078
BitmapHeaderSize: 40
NumPlanes: 1
CompressionType: 'none'
BitmapSize: 33972
HorzResolution: 0
VertResolution: 0
NumColorsUsed: 256
NumImportantColors: 0
imread, imwrite