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

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

Synopsis

y = mmreadgray ( filename )

Input

filename String

Name of file to read.

Output

y Image Gray-scale (uint8 or uint16) or binary image

Description

mmreadgray reads the image in filename and stores it in y, an uint8 gray-scale image (without colormap). If the input file is a color RGB image, it is converted to gray-scale using the equation: y = 0.2989 R + 0.587 G + 0.114 B. This functions uses de PIL module.

Examples

a=mmreadgray('cookies.tif')
mmshow(a)
a

See also

[mmmaxleveltype] [Up] [mmisbinary]