bmptopbm
Convert BMP to PBM image format
SYNOPSIS
bmptopbm [-windows | -pm | -os2] [-verbose] [bmpfile]
PARAMETERS
-windows
Assume Microsoft Windows BMP V3 format (default)
-pm
Assume OS/2 Presentation Manager BMP format
-os2
Assume OS/2 BMP format
-verbose
Print file info and progress to stderr
DESCRIPTION
bmptopbm is a utility from the Netpbm graphics suite that converts Microsoft Windows or OS/2 BMP (bitmap) files to PBM (Portable Bitmap) format, which is a simple monochrome image format.
It handles 1-bit, 4-bit, 8-bit, and 24-bit BMP files, including both uncompressed and RLE-compressed variants. For color or grayscale images, it produces high-quality black-and-white output using Floyd-Steinberg error diffusion dithering. The tool automatically corrects BMP's common bottom-to-top scanline order to standard top-to-bottom PBM order.
By default, it assumes Microsoft Windows BMP Version 3 format. Options allow specifying OS/2 or Presentation Manager variants. Input comes from a file or stdin; output goes to stdout, enabling easy piping to other Netpbm tools like pbmtoepson for printing or pnmtops for PostScript.
bmptopbm is lightweight, efficient, and essential for legacy BMP processing in Unix pipelines. It does not support transparency or advanced features from BMP V4/V5.
CAVEATS
Outputs only monochrome PBM; no color preservation. Limited BMP V4/V5 support (ignores alpha). stdin requires BMP header.
DITHERING
Floyd-Steinberg error diffusion for smooth color-to-BW conversion
COMPRESSION
Auto-detects and decodes RLE-compressed BMP files
HISTORY
Developed in Netpbm (formerly PBMPLUS) by Jef Poskanzer starting 1988. BMP support added early 1990s for Windows compatibility; maintained in Netpbm releases.


