PBM vs PGM
PGM stores one grayscale sample per pixel. It is suitable for grayscale processing and masks; exporting a colour image requires a deliberate luminance conversion and removes colour information.
Image format
Portable Bitmap: simple uncompressed raster samples for image-processing pipelines.
Explore the format
Choose a target format for your PBM images.
Marked paths may need steps such as flattening, rasterization, tone mapping or animation loss.
Choose a source format to convert to PBM.
Marked paths may need steps such as flattening, rasterization, tone mapping or animation loss.
Portable Bitmap
PBM is the original Netpbm-family format for black-and-white raster images. Each pixel is either white or black, without intermediate gray levels or colour components. Its minimal structure was designed for trouble-free interchange, including a textual representation that could pass through early email systems.
P1 uses textual zeroes and ones; P4 packs pixels into bits with row padding. In PBM, one means black and zero means white, a convention that should not be confused with grayscale intensity. There is no alpha, animation or compression. A binary file uses one bit per pixel apart from header and row-padding overhead.
Use PBM for bitonal line art, binary masks and thresholded processing results. A photo or grayscale scan needs thresholding or dithering before it fits this model. That reduction discards continuous tonal information; converting PBM to an RGB format can colour the two states but cannot recreate the original shading.
Netpbm stores these samples without compression. Reducing colour, thresholding or changing maxval can still lose information before storage; text and binary representations change the layout, not its image meaning.
This format belongs to the documented Pbmplus/Netpbm evolution. The history distinguishes the original bitmap idea, later channel models and library development.
Different formats, different trade-offs. Choose for the image and the workflow.
PGM stores one grayscale sample per pixel. It is suitable for grayscale processing and masks; exporting a colour image requires a deliberate luminance conversion and removes colour information.
PPM stores three RGB samples per pixel without compression or alpha. It is easy to inspect in processing pipelines, but sacrifices compactness and rich metadata; select it when direct sample interchange is the priority.
PAM extends Netpbm with explicit tuple types and depths, including RGB_ALPHA and GRAYSCALE_ALPHA. It suits channel-aware processing, but receiving tools must agree on the tuple meaning and it remains uncompressed.
PNG preserves decoded pixels losslessly and can carry alpha. It is useful for transparent graphics and screenshots; it does not preserve editable document layers or camera sensor data, and photographic files can be large.
PBM is the original Netpbm-family format for black-and-white raster images. Each pixel is either white or black, without intermediate gray levels or colour components. Its minimal structure was designed for trouble-free interchange, including a textual representation that could pass through early email systems.
Netpbm stores these samples without compression. Reducing colour, thresholding or changing maxval can still lose information before storage; text and binary representations change the layout, not its image meaning.
No. It stores only black and white. Dithering approximates gray with spatial patterns of those two values; PGM is the related format for actual gray samples.
Check the magic number, sample precision and tuple or channel meaning. Many simple readers accept only one binary image and 8-bit samples even though the specifications permit more.
Preserve maxval and colour interpretation when creating the rendered output. Grayscale and bitonal targets remove information deliberately; alpha requires an alpha-bearing tuple or a separate mask. Optional comments may not transfer.
Use PBM for bitonal line art, binary masks and thresholded processing results. A photo or grayscale scan needs thresholding or dithering before it fits this model. That reduction discards continuous tonal information; converting PBM to an RGB format can colour the two states but cannot recreate the original shading.