Functions > Reading and Writing Files > Image Files
  
Image Files
READ_IMAGE(“file”)—Returns the contents of image file (BMP, GIF, JPG, TGA, PCX, PBM, PGM, PPM, or TIF) as a grayscale image matrix.
READBMP(“file”)—Creates an array containing a grayscale representation of a bitmap format image file.
WRITEBMP(“file”, M)—Writes a grayscale image matrix M to image file, with format determined by the file extension (BMP, PPM, or TIF).
READRGB(“file”)—Returns the contents of image file (BMP, GIF, JPG, TGA, PBM, PGM, PPM, or TIF) as a packed RGB matrix.
WRITERGB(“file”, M)—Writes packed RGB color matrix M to a 16-million-color bitmap image file, with format determined by the file extension (BMP, PPM, or TIF).
Arguments
"file" is a string containing the file name or the full pathname and the file name.
M is an image matrix. Values must be real numbers between 0 and 255 for WRITEBMP, and between 0 and 65535 for WRITERGB. Data is written as 8-bit if it is in the range 0-255, or 16-bit if values are greater than 255.