Programming Previous page   Next Page

Importing Graphics Data

To import data into the MATLAB workspace from a graphics file, use the imread function. Using this function, you can import data from files in many standard file formats, including the Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), Joint Photographic Experts Group (JPEG), and Portable Network Graphics (PNG) formats. For a complete list of supported formats, see the imread reference page.

This example reads the image data stored in a file in JPEG format into the MATLAB workspace as the array I:

imread represents the image in the workspace as a multidimensional array of class uint8. The dimensions of the array depend on the format of the data. For example, imread uses three dimensions to represent RGB color images:


Previous page  Getting Information About Graphics Files Exporting Graphics Data Next page

© 1994-2005 The MathWorks, Inc.