WRITE_PPM

The WRITE_PPM procedure writes an image to a PPM (true-color) or PGM (gray scale) file.

PPM/PGM format is supported by the PBMPLUS toolkit for converting various image formats to and from portable formats, and by the Netpbm package.

This routine is written in the IDL language. Its source code can be found in the file write_ppm.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

WRITE_PPM, Filename , Image

Arguments

Filename

A scalar string specifying the full pathname of the PPM or PGM file to write.

Image

The 2D (gray scale) or 3D (true-color) array to be written to a file.

Keywords

ASCII

Set this keyword to force WRITE_PPM to use formatted ASCII input/output to write the image data. The default is to use the far more efficient binary input/output (RAWBITS) format.

Example

Suppose you have a grayscale image array stored in the IDL variable image . To write this image to a PGM file, use the following command:

WRITE_PPM, 'file.pgm', image

See Also

READ_PPM