Name

imfinfo — Gets image file information

Calling Sequence

info = imfinfo(filename)
info = imfinfo(filename, 'verbose')

Parameters

filename
A string, the image file name to be described.
'verbose'
Causes imfinfo to print image description on the screen.
info
A structure or Scilab typed list, also known as mlist, whose fields are:
Field Name Description
Filename String containing the image file name.
FileSize Integer indicating the size of the image file in bytes.
Format "JPEG", "TIFF", "GIF", "BMP", etc.
Width Integer indicating the number of image columns in pixels.
Height Integer indicating the number of image rows in pixels.
Depth Integer indicating the number of bits per pixel.
StorageType String containing the type of color storage in the image file, which can be 'truecolor' or 'indexed'.
NumberOfColors Size of the colormap. Equals to zero for truecolor images
ResolutionUnit "inch" or "centimeters"
XResolution number of pixels per ResolutionUnit in the X direction
YResolution number of pixels per ResolutionUnit in the Y direction

Description

imfinfo is used to get a description from image files, without reading the pixels into memory. A structure (Scilab typed list) is returned with the information, which can be accessed by their names (e.g. info.Depth, info.FileSize, ...). The 'verbose' option causes the description to be printed in an organized manner.

Examples

   initial_dir = PWD;
   chdir (SIPDIR + 'images');

   info = imfinfo('example.png');     // reads information into a tlist
   info.Depth                         // members are accessed by name
   info.StorageType
   imfinfo('example.png','verbose');  // pretty-print description

   chdir(initial_dir);

Authors

Ricardo Fabbri <ricardofabbri[at]users.sf.net>

Availability

The latest version of SIP can be found at

http://siptoolbox.sf.net

See Also

imread , imwrite , imshow