Programming |
Exporting Graphics Data
To export data from the MATLAB workspace using one of the standard graphics file formats, use the imwrite
function. Using this function, you can export data in formats such as the Tagged Image File Format (TIFF), Joint Photographic Experts Group (JPEG), and Portable Network Graphics (PNG). For a complete list of supported formats, see the imwrite
reference page.
The following example writes a multidimensional array of uint8
data I
from the MATLAB workspace into a file in TIFF format. The class of the output image written to the file depends on the format specified. For most formats, if the input array is of class uint8
, imwrite
outputs the data as 8-bit values. See the imwrite
reference page for details.
whos I Name Size Bytes Class I 650x600x3 1170000 uint8 array Grand total is 1170000 elements using 1170000 bytes imwrite(I, 'my_graphics_file.tif','tif');
Note
imwrite supports different syntaxes for several of the standard formats. For example, with TIFF file format, you can specify the type of compression used to store the image. See the imwrite reference page for details.
|
Importing Graphics Data | Working with Audio and Video Data |
© 1994-2005 The MathWorks, Inc.