.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. The PBM Format - Online Linux Manual PageSection : 5
Updated : 27 November 2013
Source : netpbm documentation
NAMEpbm - Netpbm bi-level image format .UN description
DESCRIPTIONThis program is part of Netpbm(1). The PBM format is a lowest common denominator monochrome file format. It serves as the common language of a large family of bitmap image conversion filters. Because the format pays no heed to efficiency, it is simple and general enough that one can easily develop programs to convert to and from just about any other graphics format, or to manipulate the image. The name "PBM" is an acronym derived from "Portable Bit Map." This is not a format that one would normally use to store a file or to transmit it to someone -- it's too expensive and not expressive enough for that. It's just an intermediary format. In it's purest use, it lives only in a pipe between two other programs. .UN layout
THE LAYOUTThe format definition is as follows. A PBM file consists of a sequence of one or more PBM images. There are no data, delimiters, or padding before, after, or between images. Each PBM image consists of the following: • A "magic number" for identifying the file type. A pbm image's magic number is the two characters "P4". • Whitespace (blanks, TABs, CRs, LFs). • The width in pixels of the image, formatted as ASCII characters in decimal. • Whitespace. • The height in pixels of the image, again in ASCII decimal. • A single whitespace character (usually a newline). • A raster of Height rows, in order from top to bottom. Each row is Width bits, packed 8 to a byte, with don't care bits to fill out the last byte in the row. Each bit represents a pixel: 1 is black, 0 is white. The order of the pixels is left to right. The order of their storage within each file byte is most significant bit to least significant bit. The order of the file bytes is from the beginning of the file toward the end of the file. A row of an image is horizontal. A column is vertical. The pixels in the image are square and contiguous. • Before the whitespace character that delimits the raster, any characters from a "#" through the next carriage return or newline character, is a comment and is ignored. Note that this is rather unconventional, because a comment can actually be in the middle of what you might consider a token. Note also that this means if you have a comment right before the raster, the newline at the end of the comment is not sufficient to delimit the raster. All characters referred to herein are encoded in ASCII. "newline" refers to the character known in ASCII as Line Feed or LF. A "white space" character is space, CR, LF, TAB, VT, or FF (I.e. what the ANSI standard C isspace() function calls white space). .UN plainpbm
Plain PBMThere is actually another version of the PBM format, even more simplistic, more lavishly wasteful of space than PBM, called Plain PBM. Plain PBM actually came first, but even its inventor couldn't stand its recklessly squanderous use of resources after a while and switched to what we now know as the regular PBM format. But Plain PBM is so redundant -- so overstated -- that it's virtually impossible to break. You can send it through the most liberal mail system (which was the original purpose of the PBM format) and it will arrive still readable. You can flip a dozen random bits and easily piece back together the original image. And we hardly need to define the format here, because you can decode it by inspection. Netpbm programs generate Raw PBM format instead of Plain PBM by default, but the common option -plain chooses Plain PBM. The difference is: • There is exactly one image in a file. • The "magic number" is "P1" instead of "P4". • Each pixel in the raster is represented by a byte containing ASCII '1' or '0', representing black and white respectively. There are no fill bits at the end of a row. • White space in the raster section is ignored. • You can put any junk you want after the raster, if it starts with a white space character. • No line should be longer than 70 characters. Here is an example of a small image in the plain PBM format. P1
# feep.pbm
24 7
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 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0
0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0
0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0
0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 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
There is a newline character at the end of each of these lines. You can generate the Plain PBM format from the regular PBM format (first image in the file only) with the pnmtoplainpnm program. Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a bitmap. .UN internetmediatype
INTERNET MEDIA TYPENo Internet Media Type (aka MIME type, content type) for PBM has been registered with IANA, but the value image/x-portable-bitmap is conventional. Note that the PNM Internet Media Type image/x-portable-anymap also applies. .UN filename
FILE NAMEThere are no requirements on the name of a PBM file, but the convention is to use the suffix ".pbm". "pnm" is also conventional, for cases where distinguishing between the particular subformats of PNM is not convenient. .UN compatibility
COMPATIBILITYBefore July 2000, there could be at most one image in a PBM file. As a result, most tools to process PBM files ignore (and don't read) any data after the first image. .UN seealso
SEE ALSOlibnetpbm(1), "pnm(1), "pgm(1), "ppm(1), "pam(1), programs that process PBM(1)
DOCUMENT SOURCEThis manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at http://netpbm.sourceforge.net/doc/pbm.html 0
Johanes Gumabo
Data Size : 17,189 byte
man-pbm.5Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 198,710
Visitor ID : :
Visitor IP : 3.144.21.237 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (rof_escape_sequence|91|pbm.5|1/2|\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
) (parse_manual_page_|249|pbm.5|1/2|\"|.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
) (parse_manual_page_|249|pbm.5|12|UN|.UN description
) (parse_manual_page_|249|pbm.5|33|UN|.UN layout
) (parse_manual_page_|249|pbm.5|94|UN|.UN plainpbm
) (parse_manual_page_|249|pbm.5|166|UN|.UN internetmediatype
) (parse_manual_page_|249|pbm.5|177|UN|.UN filename
) (parse_manual_page_|249|pbm.5|186|UN|.UN compatibility
) (parse_manual_page_|249|pbm.5|193|UN|.UN seealso
)