Graphics Previous page   Next Page

Reading a Graphics Image

The function imread reads an image from any supported graphics image file in any of the supported bit depths. Most of the images that you will read are 8-bit. When these are read into memory, MATLAB stores them as class uint8. The main exception to this rule is that MATLAB supports 16-bit data for PNG and TIFF images. If you read a 16-bit PNG or TIFF image, it is stored as class uint16.

The following statement reads the image ngc6543a.jpg into the workspace variable RGB and then displays the image using the image function.

You can write (save) image data using the imwrite function. The statements

create a BMP file containing the clown image.


Previous page  Reading, Writing, and Querying Graphics Image Files Writing a Graphics Image Next page

© 1994-2005 The MathWorks, Inc.