cmuwmtopbm
Convert CMU window manager image to portable bitmap
TLDR
Convert a CMU window manager bitmap to a PBM image
SYNOPSIS
cmuwmtopbm [cmuwmfile]
DESCRIPTION
cmuwmtopbm is a utility in the Netpbm graphics toolkit that converts monochrome bitmap images from the Carnegie Mellon University (CMU) Window Manager format to Portable Bitmap (PBM) format.
CMU WM bitmaps are simple black-and-white images originating from the CMU window manager software. The format features a header line with four decimal integers: width (pixels), height (pixels), x-hotspot, and y-hotspot (cursor hotspot coordinates, often 0). This is followed by the image data as packed bytes, where each bit represents a pixel (1 for black, 0 for white), with bytes in left-to-right, top-to-bottom order and most significant bit first.
The command reads from a specified cmuwmfile or standard input and writes a binary PBM image (P4 format) to standard output. This enables integration with other Netpbm tools for further conversion, scaling, or editing. It preserves the image dimensions but ignores hotspot data, as PBM lacks cursor metadata.
Primarily used for legacy file handling, archiving old icons or cursors from CMU systems into portable formats compatible with modern image viewers and processors.
CAVEATS
Expects valid CMU WM header and data; malformed input produces errors or corrupted output. Outputs binary PBM (P4), not ASCII (P1). No error checking for hotspot values. Deprecated format; prefer XBM or modern equivalents.
EXAMPLE
cmuwmtopbm icon.cmuwm > icon.pbm
pnmtopng icon.pbm > icon.png
Converts CMU WM to PBM, then to PNG.
CMU WM HEADER
First line: width height xhot yhot (e.g., 16 16 0 0)
Followed by ceiling(width*height/8) bytes of bit data.
SEE ALSO
pbmtocmuwm(1), xbmtopbm(1), pbm(5), pnm(5)


