Main Content

imageinfo

Image Information tool

Description

Use the imageinfo function to create an Image Information tool. The tool displays information about the basic attributes and metadata of an image. The information includes the width, height, data type, and image type.

Image Information tool displaying image details and metadata.

imageinfo creates an Image Information tool that displays information about the basic attributes of the image in the current figure.

imageinfo(h) creates an Image Information tool associated with the image in the graphics container h.

imageinfo(filename) creates an Image Information tool containing image metadata from the graphics file filename. The image does not have to be displayed in a figure window.

example

imageinfo(info) creates an Image Information tool containing the image metadata in the structure info.

imageinfo(hImage,filename) creates an Image Information tool containing information about the basic attributes of the image hImage and the image metadata from the graphics file filename.

imageinfo(hImage,info) creates an Image Information tool containing information about the basic attributes of the image hImage and the image metadata in the structure info.

hTool = imageinfo(___) returns the figure hTool containing the Image Information tool.

Examples

collapse all

There are several ways to open an Image Information tool. This example demonstrates three different ways to open this tool.

Open an Image Information tool containing metadata from an image file. It is not necessary to display the image.

imageinfo('peppers.png')

Figure Image Info (peppers.png) contains objects of type uitoolbar, uicontrol, uitable.

Display an image in a figure window.

h = imshow('bag.png');

Figure contains an axes object. The hidden axes object contains an object of type image.

Get the image metadata.

info = imfinfo('bag.png');

Open an Image Information tool associated with the figure that also contains the image metadata.

imageinfo(h,info)

Figure Image Info (Figure 1) contains objects of type uitoolbar, uicontrol, uitable.

Display a new image, then open an Image Information tool associated with the image.

imshow('canoe.tif')
imageinfo

Figure Image Info (Figure 3) contains objects of type uitoolbar, uicontrol, uitable.

Input Arguments

collapse all

Graphics object containing the image, specified as a Figure, Axes, or Image object. If h is an axes or figure, then imageinfo uses the first image returned by findobj(h,Type="image").

Image, specified as an Image object.

Image filename, specified as a string scalar or character vector. filename can be any file type that has been registered with an information function in the file formats registry, imformats, so its information can be read by imfinfo. filename can also be a DICOM, NITF, Interfile, or Analyze file.

Image metadata, specified as a structure returned by the functions imfinfo, dicominfo, nitfinfo, interfileinfo, or analyze75info. You can also specify info as a user-created structure.

Output Arguments

collapse all

Image Information tool, returned as a Figure object.

Tips

  • The table lists the basic image attribute information included in the Image Information tool display. Note that the tool contains either four or six fields, depending on the type of image.

    Attribute Name

    Value

    Width (columns)

    Number of columns in the image

    Height (rows)

    Number of rows in the image

    Class

    Data type used by the image, such as uint8.

    Note

    For single or int16 images, imageinfo returns a Class value of double, because the image object converts the CData of these images to double.

    Image type

    One of the image types identified by the Image Processing Toolbox™ software: intensity truecolor, binary, or indexed.

    Minimum intensity or index

    For grayscale images, this value represents the lowest intensity value of any pixel.

    For indexed images, this value represents the lowest index value into a colormap.

    This field is not included for binary or truecolor images.

    Maximum intensity or index

    For grayscale images, this value represents the highest intensity value of any pixel.

    For indexed images, this value represents the highest index value into a colormap.

    This field is not included for binary or truecolor images.

  • imageinfo gets information about image attributes by querying the image object's CData. The image object converts the CData for single or int16 images to class double. In these cases, imageinfo displays a Class attribute of double, even though the image is of class single or int16. For example,

    h = imshow(ones(10,"int16"));
    class(get(h,"CData"))

Version History

Introduced before R2006a