pgm (5)
portable graymap file format
DESCRIPTION
P2
# feep.pgm
24 7
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Programs that read this format should be as lenient as possible,
accepting anything that looks remotely like a graymap.
There is also a variant on the format, available
by setting the RAWBITS option at compile time. This variant is
different in the following ways:
RAWBITS
The "magic number" is "P5" instead of "P2".
The gray values are stored as plain bytes, instead of ASCII decimal.
No whitespace is allowed in the grays section, and only a single character
of whitespace (typically a newline) is allowed after the maxval.
The files are smaller and many times faster to read and write.
Note that this raw format can only be used for maxvals less than
or equal to 255.
If you use the
pgm
library and try to write a file with a larger maxval,
it will automatically fall back on the slower but more general plain
format.
SEE ALSO
AUTHOR
Copyright (C) 1989, 1991 by Jef Poskanzer.
|