]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man5/pbm.5
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man5 / pbm.5
1 .\"
2 .\" $FreeBSD$
3 .\"
4 .Dd September 27, 1991
5 .Dt PBM 5
6 .Os
7 .Sh NAME
8 .Nm pbm
9 .Nd portable bitmap file format
10 .Sh DESCRIPTION
11 The portable bitmap format is a lowest common denominator monochrome
12 file format.
13 It was originally designed to make it reasonable to mail bitmaps
14 between different types of machines using the typical stupid network
15 mailers we have today.
16 Now it serves as the common language of a large family of bitmap
17 conversion filters.
18 The definition is as follows:
19 .Pp
20 .Bl -bullet -compact
21 .It
22 A "magic number" for identifying the file type.
23 A pbm file's magic number is the two characters "P1".
24 .It
25 Whitespace (blanks, TABs, CRs, LFs).
26 .It
27 A width, formatted as ASCII characters in decimal.
28 .It
29 Whitespace.
30 .It
31 A height, again in ASCII decimal.
32 .It
33 Whitespace.
34 .It
35 Width * height bits, each either '1' or '0', starting at the top-left
36 corner of the bitmap, proceeding in normal English reading order.
37 .It
38 The character '1' means black, '0' means white.
39 .It
40 Whitespace in the bits section is ignored.
41 .It
42 Characters from a "#" to the next end-of-line are ignored (comments).
43 .It
44 No line should be longer than 70 characters.
45 .El
46 .Pp
47 Here is an example of a small bitmap in this format:
48 .Bd -literal
49 P1
50 # feep.pbm
51 24 7
52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
53 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0
54 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0
55 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0
56 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
57 0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0
58 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
59 .Ed
60 .Pp
61 Programs that read this format should be as lenient as possible,
62 accepting anything that looks remotely like a bitmap.
63 .Pp
64 There is also a variant on the format, available
65 by setting the RAWBITS option at compile time.
66 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.