Main Content

impixelinfo

Pixel Information tool

Description

Use the impixelinfo function to create a Pixel Information tool. The Pixel Information tool displays information about the pixel in an image that the pointer is positioned over. If the figure contains multiple images, the tool displays pixel information for all the images. For more information about the tool, see Pixel Information Tool.

Pixel Information tool in the bottom left corner of the figure window, displaying the (x, y) coordinates and the value of the pixel under the pointer.

impixelinfo creates a Pixel Information tool in the current figure.

example

impixelinfo(h) creates a Pixel Information tool in the figure specified by the handle h.

impixelinfo(hParent,hImage) creates a Pixel Information tool in hparent that provides information about the pixels in hImage.

hTool = impixelinfo(___) returns the panel hTool containing the Pixel Information tool.

Examples

collapse all

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.

figure
subplot(1,2,1), imshow("liftingbody.png")
subplot(1,2,2), imshow("autumn.tif")
impixelinfo;

Input Arguments

collapse all

Graphics object, specified as a Figure, Panel, Axes, or Image object. Figure, panel, and axes objects must contain at least one image object.

If h is a figure, then the parent of the Pixel Information tool is h. Otherwise, the parent of the Pixel Information tool is the figure that is an ancestor of h.

Parent of the Pixel Information tool, specified as a Figure or Panel object.

Images, specified as an Image object or an array of Image objects.

Output Arguments

collapse all

Pixel Information tool, returned as a Panel object.

More About

collapse all

Pixel Information Tool

The Pixel Information tool is a panel 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

Example

Intensity

(X,Y) Intensity

(13,30) 82

Indexed

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

(2,6) <4> [0.29 0.05 0.32]

Binary

(X,Y) BW

(12,1) 0

Truecolor

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

Tips

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

  • 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.

Version History

Introduced before R2006a