[mmreadgray] [Up] [mmisbinary] Image file I/O

mmwrite
Write a gray-scale image into a commercial file format.

Synopsis

function mmwrite ( f , filename )

Input

f Image Gray-scale (uint8 or uint16) or binary image
filename String

Name of the file. Possible extensions: tif, hdf, jpg, bmp, pcx, xwd.

Description

mmwrite writes the image f in the file filename. This function calls the MATLAB function imwrite. If the format generated is BMP, PCX or XWD, a colormap is created to keep the compatibility with imwrite.

Examples

a= uint8( ones(5,5) );
mmwrite(a, 'ones5.bmp');
b = mmreadgray('ones5.bmp')
b =
    1    1    1    1    1
    1    1    1    1    1
    1    1    1    1    1
    1    1    1    1    1
    1    1    1    1    1

See also

mmreadgray Read an image from a commercial file format and stores it as a gray-scale image.
[mmreadgray] [Up] [mmisbinary]