Deleted Added
full compact
pbm.5 (14046) pbm.5 (20781)
1.TH pbm 5 "27 September 1991"
2.SH NAME
3pbm - portable bitmap file format
4.SH DESCRIPTION
1.Dd "September 27, 1991"
2.Dt PBM 5
3.Sh NAME
4.Nm pbm
5.Nd portable bitmap file format
6.Sh DESCRIPTION
5The portable bitmap format is a lowest common denominator monochrome
6file format.
7The portable bitmap format is a lowest common denominator monochrome
8file format.
7.IX "PBM file format"
8It was originally designed to make it reasonable to mail bitmaps
9between different types of machines using the typical stupid network
10mailers we have today.
11Now it serves as the common language of a large family of bitmap
12conversion filters.
13The definition is as follows:
9It was originally designed to make it reasonable to mail bitmaps
10between different types of machines using the typical stupid network
11mailers we have today.
12Now it serves as the common language of a large family of bitmap
13conversion filters.
14The definition is as follows:
14.IP - 2
15.Pp
16.Bl -bullet -compact
17.It
15A "magic number" for identifying the file type.
16A pbm file's magic number is the two characters "P1".
18A "magic number" for identifying the file type.
19A pbm file's magic number is the two characters "P1".
17.IX "magic numbers"
18.IP - 2
20.It
19Whitespace (blanks, TABs, CRs, LFs).
21Whitespace (blanks, TABs, CRs, LFs).
20.IP - 2
22.It
21A width, formatted as ASCII characters in decimal.
23A width, formatted as ASCII characters in decimal.
22.IP - 2
24.It
23Whitespace.
25Whitespace.
24.IP - 2
26.It
25A height, again in ASCII decimal.
27A height, again in ASCII decimal.
26.IP - 2
28.It
27Whitespace.
29Whitespace.
28.IP - 2
30.It
29Width * height bits, each either '1' or '0', starting at the top-left
30corner of the bitmap, proceeding in normal English reading order.
31Width * height bits, each either '1' or '0', starting at the top-left
32corner of the bitmap, proceeding in normal English reading order.
31.IP - 2
33.It
32The character '1' means black, '0' means white.
34The character '1' means black, '0' means white.
33.IP - 2
35.It
34Whitespace in the bits section is ignored.
36Whitespace in the bits section is ignored.
35.IP - 2
37.It
36Characters from a "#" to the next end-of-line are ignored (comments).
38Characters from a "#" to the next end-of-line are ignored (comments).
37.IP - 2
39.It
38No line should be longer than 70 characters.
40No line should be longer than 70 characters.
39.PP
41.El
42.Pp
40Here is an example of a small bitmap in this format:
43Here is an example of a small bitmap in this format:
41.nf
44.Bd -literal
42P1
43# feep.pbm
4424 7
450 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
460 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0
470 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0
480 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0
490 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
500 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0
510 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
45P1
46# feep.pbm
4724 7
480 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
490 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0
500 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0
510 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0
520 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
530 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0
540 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
52.fi
53.PP
55.Ed
56.Pp
54Programs that read this format should be as lenient as possible,
55accepting anything that looks remotely like a bitmap.
57Programs that read this format should be as lenient as possible,
58accepting anything that looks remotely like a bitmap.
56.PP
59.Pp
57There is also a variant on the format, available
58by setting the RAWBITS option at compile time. This variant is
60There is also a variant on the format, available
61by setting the RAWBITS option at compile time. This variant is
59.IX RAWBITS
60different in the following ways:
62different in the following ways:
61.IP - 2
63.Pp
64.Bl -bullet -compact
65.It
62The "magic number" is "P4" instead of "P1".
66The "magic number" is "P4" instead of "P1".
63.IP - 2
67.It
64The bits are stored eight per byte, high bit first low bit last.
68The bits are stored eight per byte, high bit first low bit last.
65.IP - 2
69.It
66No whitespace is allowed in the bits section, and only a single character
67of whitespace (typically a newline) is allowed after the height.
70No whitespace is allowed in the bits section, and only a single character
71of whitespace (typically a newline) is allowed after the height.
68.IP - 2
72.It
69The files are eight times smaller and many times faster to read and write.
73The files are eight times smaller and many times faster to read and write.
70.SH AUTHOR
74.El
75.Sh AUTHOR
71Copyright (C) 1989, 1991 by Jef Poskanzer.
72.\" Permission to use, copy, modify, and distribute this software and its
73.\" documentation for any purpose and without fee is hereby granted, provided
74.\" that the above copyright notice appear in all copies and that both that
75.\" copyright notice and this permission notice appear in supporting
76.\" documentation. This software is provided "as is" without express or
77.\" implied warranty.
76Copyright (C) 1989, 1991 by Jef Poskanzer.
77.\" Permission to use, copy, modify, and distribute this software and its
78.\" documentation for any purpose and without fee is hereby granted, provided
79.\" that the above copyright notice appear in all copies and that both that
80.\" copyright notice and this permission notice appear in supporting
81.\" documentation. This software is provided "as is" without express or
82.\" implied warranty.