The WRITE_PPM procedure writes an image to a PPM (true-color) or PGM (gray scale) file.
NOTE: WRITE_PPM only writes 8-bit deep PGM/PPM files of the standard type. Images should be ordered so that the first row is the top row.
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.
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: