Main Content

Interactive Image Viewing and Processing Tools

The toolbox includes several tools that you can use to interact with an image displayed in a MATLAB® figure window. For example, you can use tools to adjust the display of the image, get information about the image data, and adjust the contrast or crop the image.

You can use the tools independently or in combination. You can create custom image processing apps that open a combination of tools and initialize their display and interactions. For more information, see Interactive Tool Workflow.

You can also access all tools using Image Tool (imtool).

ToolExampleDescription

Adjust Contrast tool

Adjust Contrast tool with sliders and editable fields that enable you to adjust the histogram of pixel values.

Displays a histogram of the target image and enables interactive adjustment of contrast and brightness by manipulation of the display range.

Use the imcontrast function to create the tool in a separate figure window and associate it with an image.

Choose Colormap tool

Choose Colormap tool with a list of MATLAB colormap functions.

Allows you to change the colormap of the target figure. You can select one of the MATLAB colormaps, select a colormap variable from the MATLAB workspace, or enter a custom MATLAB function.

Use the imcolormaptool function to launch the tool in a separate figure window.

Crop Image tool

Crop Image tool displaying the blue border of a region to be cropped, with controls that enable resizing and moving the crop window.

Displays a draggable, resizable rectangle on an image. You can move and resize the rectangle to define the crop region. Double-click to perform the crop operation or select Crop Image from the context menu.

Use the imcrop function to create the tool and associate it with an image.

Display Range tool

Display Range tool displaying a two-element numeric vector whose values vary with data type.

Displays the display range values of the associated image.

Use the imdisplayrange function to create the tool, associate it with an image, and embed it in a figure or panel.

Distance tool

Distance tool displaying a blue line of length 128.97 pixels over an image.

Displays a draggable, resizable line on an image. Superimposed on the line is the distance between the two endpoints of the line. The distance is measured in units specified by the XData and YData properties, which is pixels by default.

Use the imdistline function to create the tool and associate it with an image.

Image Information tool

Image Information tool displaying image details and metadata.

Displays basic attributes about the target image. If the image displayed was specified as a graphics file, the tool displays any metadata that the image file might contain.

Use the imageinfo function to create the tool in a separate figure window and associate it with an image.

Magnification box

Magnification box in the bottom left corner of the figure window, showing a magnification value of 80%.

Creates a text edit box containing the current magnification of the target image. Users can change the magnification of the image by entering a new magnification value.

Use immagbox to create the tool, associate it with an image, and embed it in a figure or panel.

Note

The target image must be contained in a scroll panel.

Overview tool

Overview tool with blue detail rectangle over a portion of the image.

Displays the target image in its entirety with the portion currently visible in the scroll panel outlined by a rectangle superimposed on the image. Moving the rectangle changes the portion of the target image that is currently visible in the scroll panel.

Use imoverview to create the tool in a separate figure window and associate it with an image.

Use imoverviewpanel to create the tool in a panel that can be embedded within another figure or panel.

Note

The target image must be contained in a scroll panel.

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.

Displays information about the pixel the mouse is over in the target image.

Use impixelinfo to create the tool, associate it with an image, and display it in a figure or panel.

If you want to display only the pixel values, without the Pixel info label, use impixelinfoval.

Pixel Region tool

Pixel Region tool displays the numeric pixel value over each pixel in a magnified region.

Display pixel values for a specified region in the target image.

Use impixelregion to create the tool in a separate figure window and associate it with an image.

Use impixelregionpanel to create the tool as a panel that can be embedded within another figure or panel.

Save Image tool

Save Image tool showing the contents of the current directory with controls to change the directory and specify the filename and filetype.

Display the Save Image dialog window. In the window, navigate to the desired directory, specify the name of the output image, and choose the file format used to store the image.

Use imsave to create the tool in a separate figure window and associate it with an image.

Scroll Panel tool

Figure window with scroll panels on the right and bottom sides to facilitate scrolling.

Display target image in a scrollable panel.

Use imscrollpanel to add a scroll panel to an image displayed in a figure window.

Related Topics