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