Image Processing Toolbox User's Guide |
4. Write the Image to a Disk File
To write the newly adjusted image I2
to a disk file, use the imwrite
function. If you include the filename extension '.png'
, the imwrite
function writes the image to a file in Portable Network Graphics (PNG) format, but you can specify other formats.
See the imwrite
function reference page for a list of file formats it supports. See also Writing a Graphics Image for a tutorial discussion on writing images using the Image Processing Toolbox.
5. Check the Contents of the Newly Written File
To see what imwrite
wrote to the disk file, use the imfinfo
function. This function returns information about the image in the file, such as its format, size, width, and height. See Querying a Graphics File for more information about using imfinfo
.
imfinfo('pout2.png') ans = Filename: 'pout2.png' FileModDate: '29-Dec-2003 09:34:39' FileSize: 36938 Format: 'png' FormatVersion: [] Width: 240 Height: 291 BitDepth: 8 ColorType: 'grayscale' FormatSignature: [137 80 78 71 13 10 26 10] Colormap: [] Histogram: [] InterlaceType: 'none' Transparency: 'none' SimpleTransparencyData: [] BackgroundColor: [] RenderingIntent: [] Chromaticities: [] Gamma: [] XResolution: [] YResolution: [] ResolutionUnit: [] XOffset: [] YOffset: [] OffsetUnit: [] SignificantBits: [] ImageModTime: '29 Dec 2003 14:34:39 +0000' Title: [] Author: [] Description: [] Copyright: [] CreationTime: [] Software: [] Disclaimer: [] Warning: [] Source: [] Comment: [] OtherText: []
3. Improve Image Contrast | Example 2 -- Advanced Topics |
© 1994-2005 The MathWorks, Inc.