The Image Processing Toolbox™ software includes two display functions, imshow
and imtool
. Both functions work within the graphics
architecture: they create an image object and display it in an axes object contained in a
figure object.
imshow
is the fundamental image display function. Use
imshow
when you want to display any of the different image types
supported by the toolbox, such as grayscale (intensity), truecolor (RGB), binary, and indexed.
For more information, see Display an Image in Figure Window. The
imshow
function is also a key building block for image applications you
can create using the toolbox modular tools. For more information, see Build Interactive Tools.
The other toolbox display function, imtool
, opens the Image
Viewer app, which presents an integrated environment for displaying images and
performing some common image processing tasks. Image Viewer provides all the image
display capabilities of imshow
but also provides access to several other
tools for navigating and exploring images, such as scroll bars, the Pixel Region tool, the
Image Information tool, and the Adjust Contrast tool. For more information, see Get Started with Image Viewer App.
In general, using the toolbox functions to display images is preferable to using
MATLAB® image display functions image
and imagesc
because the toolbox functions set certain graphics object properties automatically to optimize
the image display. The following table lists these properties and their settings for each
image type. In the table, X
represents an indexed image,
I
represents a grayscale image, BW
represents a binary
image, and RGB
represents a truecolor image.
Note
Both imshow
and imtool
can perform automatic
scaling of image data. When called with the syntax
imshow(I,'DisplayRange',[])
, and similarly for
imtool
, the functions set the axes CLim
property to
[min(I(:)) max(I(:))]
. CDataMapping
is always
scaled
for grayscale images, so that the value
min(I(:))
is displayed using the first color map color, and the value
max(I(:))
is displayed using the last color map color.
Property |
Indexed Images |
Grayscale Images |
Binary Images |
Truecolor Images |
---|---|---|---|---|
|
Set to the data in |
Set to the data in |
Set to data in |
Set to data in |
|
Set to |
Set to |
Set to |
Ignored when |
|
Does not apply |
|
Set to |
Ignored when |
|
Set to data in | Set to grayscale color map | Set to a grayscale color map whose values range from black to white |
Ignored when |