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