Image Processing Toolbox User's Guide Previous page   Next Page

Pixel information tool



impixelinfo creates a pixel information tool in the current figure. The pixel information tool displays information about the pixel in an image that the cursor is positioned over. The tool displays pixel information for all the images in a figure..

The tool is a uipanel object, positioned in the lower-left corner of the figure. It contains the text string "Pixel info:" followed by the x and y coordinates of the pixel and its value, as shown in the following figure.

The information displayed depends on the image type. The following table shows the information displayed for each image type. If the cursor is outside of the image area in the figure, the pixel information tool displays the default pixel information string.

Image Type
Default Pixel Information String
(X,Y) Intensity
(13,30) 82
(X,Y) <index> [R G B]
(2.6) <4> [0.29 0.05 0.32]
(X,Y) BW
(12,1) 0
(X,Y) [R G B]
(19,10) [15 255 10]

If you want to display the pixel information without the "Pixel Info" label, use the impixelinfoval function.

impixelinfo(h) creates a pixel information tool in the figure specified by h, where h is a handle to an image, axes, uipanel, or figure object. Axes, uipanel, or figure objects must contain at least one image object.

impixelinfo(hparent,himage) creates a pixel information tool in hparent that provides information about the pixels in himage. himage is a handle to an image or an array of image handles. hparent is a handle to the figure or uipanel object that contains the pixel information tool.

hpanel=impixelinfo(...) returns a handle to the pixel information tool uipanel.


To copy the pixel information string to the clipboard, right-click while the cursor is positioned over a pixel. In the context menu displayed, choose Copy pixel info.


This example displays an image and adds a pixel information tool to the figure. The example shows how you can change the position of the tool in the figure using properties of the tool uipanel object.

This example shows how the pixel information tool works in a figure containing multiple images of different types.

See Also

impixelinfoval, impixelregion, imshow, imtool

Previous page  impixel impixelinfoval Next page

© 1994-2005 The MathWorks, Inc.