| 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 filename.fmt.
This table lists the possible values for fmt:filename is a TIFF or HDF file containing more than one image, 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 nine 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('flowers.bmp')
info =
Filename: 'flowers.bmp'
FileModDate: '16-Oct-1996 11:41:38'
FileSize: 182078
Format: 'bmp'
FormatVersion: 'Version 3 (Microsoft Windows 3.x)'
Width: 500
Height: 362
BitDepth: 8
ColorType: 'indexed'
FormatSignature: 'BM'
NumColormapEntries: 256
Colormap: [256x3 double]
RedMask: []
GreenMask: []
BlueMask: []
ImageDataOffset: 1078
BitmapHeaderSize: 40
NumPlanes: 1
CompressionType: 'none'
BitmapSize: 181000
HorzResolution: 0
VertResolution: 0
NumColorsUsed: 256
NumImportantColors: 0
imread Read image from graphics file
imwrite Write an image to a graphics file