Programming |
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:
whos I Name Size Bytes Class I 650x600x3 1170000 uint8 array Grand total is 1170000 elements using 1170000 bytes
Getting Information About Graphics Files | Exporting Graphics Data |
© 1994-2005 The MathWorks, Inc.