Image Processing Toolbox    

Displaying Images Directly from Disk

Generally, when you want to display an image, you will first use imread to load it and the data is stored as one or more variables in the MATLAB workspace. However, if you do not want to load an image directly before displaying it, you can display a file directly using this syntax.

The file must be in the current directory or on the MATLAB path.

For example, to display a file named flowers.tif,

If the image has multiple frames, imshow will only display the first frame. For information on the display options for multiframe images, see Displaying Multiframe Images.

This syntax is very useful for scanning through images. Note, however, that when you use this syntax, the image data is not stored in the MATLAB workspace. If you want to bring the image into the workspace, use the getimage function, which gets the image data from the current Handle Graphics image object. For example,

will assign flowers.tif to rgb if the figure window in which it is displayed is currently active.


  Displaying RGB Images Special Display Techniques