This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Pixel Information tool


hpanel = impixelinfo(...)


impixelinfo creates a Pixel Information tool in the current figure. The Pixel Information tool displays information about the pixel in an image that the pointer is positioned over. The tool can display pixel information for all the images in a figure.

The Pixel Information tool is a uipanel object, positioned in the lower-left corner of the figure. The tool contains the text label Pixel info: followed by the pixel information. Before you move the pointer over the image, the tool contains the default pixel information text (X,Y) Pixel Value. Once you move the pointer over the image, the information displayed varies by image type, as shown in the following table. If you move the pointer off the image, the pixel information tool displays the default pixel information label for that image type.

Image Type

Pixel Information



(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]

Floating point image with CDataMapping property set to direct

(X,Y) value <index> [R G B]

(19,10) 82 <4> [15 255 10]

For example, for grayscale (intensity) images, the pixel information tool displays the x and y coordinates of the pixel and its value, as shown in the following figure.

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 label to the clipboard, right-click while the pointer is positioned over a pixel. In the context menu displayed, choose Copy pixel info.


Display an image and add 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.

h = imshow('hestain.png');
hp = impixelinfo;
set(hp,'Position',[5 1 300 20]);

Use the Pixel Information tool in a figure containing multiple images of different types.

subplot(1,2,1), imshow('liftingbody.png');
subplot(1,2,2), imshow('autumn.tif');

Introduced before R2006a

Was this topic helpful?