ImageGear for Java User Guide > ImageGear Imaging Formats Reference > ImageGear Supported File Formats Reference > PBM |
Full Name | PBM (Portable Bitmap File Format) |
Format ID | ImGearFormats.PBM |
File Extension(s) | *.pbm |
Data Type | Raster Image |
Data Encoding | Binary |
IG Multipage Support | No |
IG Alpha Channel Support | No |
IG Platforms Support | WIN32, WIN64, Linux32, Linux64, MAC32, MAC64 |
October 1991 - last release
None
This is useful for quick and easy transfer of monochrome bitmap images, although the encoding scheme is not efficient in terms of storage space. This format, as well as the PGM, PNM, and PPM formats, are at the core of a set of utility programs also written by Jef Poskanzer. Among other things, these formats serve as intermediary storage methods for the conversion of other file formats.
The Portable Bitmap File Format structure is very simple. It begins with a short ASCII header that contains the file type identifier (magic number), the width and height of the image, and perhaps a comment line identifying the filename. Following white space (usually a carriage return) is the bitmap data. The number of bits is equal to the width * height. A pixel value of 0 indicates white, and a value of 1 indicates black.
The magic number of the header can have one of two values: either P1 or P4. P1 indicates that the bitmap data are to be read as ASCII decimal values. P4 indicates that the bitmap data are stored as plain bytes. Because 8 pixel values (1 bit each) are stored in one byte, the file is 8 times smaller than in the ASCII decimal format. White spaces are permitted in the P1 format but not permitted in the P4 format.
ImageGear uses PBM filter to handle the whole family of formats: PBM (1-bit), PGM (grayscale), PPM (truecolor) and PNM (collective name for all of above). When saving image as ImGearFormats.PBM format, ImageGear chooses particular format (PBM, PGM, PNM or PPM) depending on image bit depth. |
Kay, David C. and John R. Levine. Graphics File Formats, 2nd ed. Windcrest /McGraw-Hill, 1995.
PBM Specification by Jef Poskanzer, copyright A 1989, 1991.