pbmtox10bm
Convert PBM image to X10 bitmap font
TLDR
View documentation for the current command
SYNOPSIS
`pbmtox10bm` [-name bitmapname] [pbmfile]
PARAMETERS
-name
Specifies a name for the bitmap. The X10 bitmap format includes a name field; if not provided, the command will generate one based on the input filename or "image" if reading from stdin.
pbmfile
The path to the Portable Bitmap (PBM) file to be converted. If omitted, `pbmtox10bm` will read the PBM data from standard input.
DESCRIPTION
The `pbmtox10bm` command is a utility within the Netpbm image manipulation toolkit. Its primary function is to convert a Portable Bitmap (PBM) image file into an X10 bitmap format file. The X10 bitmap format is an older, specific bitmap representation used by the X Window System Version 10. This command is particularly useful for preparing monochrome images for use with legacy X10 applications or environments, although X11 (X Window System Version 11) is now the standard.
PBM files are simple, plain-text or binary files representing a monochrome image, where each pixel is either black or white. `pbmtox10bm` reads this input and transforms it into the specific byte order and header structure required by the X10 bitmap format. If no input file is specified, it reads from standard input. The converted X10 bitmap data is then written to standard output. Like other Netpbm tools, `pbmtox10bm` is designed to be a filter, allowing it to be easily chained with other commands in a pipeline for more complex image processing tasks.
CAVEATS
The X10 bitmap format is largely obsolete, having been superseded by the X11 bitmap format (handled by `pbmtoxbm`).
This command only works with PBM (monochrome) images. If you have a grayscale (PGM) or color (PPM) image, you must first convert it to PBM using `pgmtopbm` or `ppmtopbm` respectively, likely with dithering, before using `pbmtox10bm`.
The output is typically written to standard output, so you'll usually need to redirect it to a file (e.g., `pbmtox10bm image.pbm > image.x10bm`).
OUTPUT FORMAT
The output generated by `pbmtox10bm` is a plain-text file in the X10 bitmap format. This format is a C source code array definition, making it suitable for direct inclusion in C programs. It defines the image data as a static array of characters or unsigned chars, along with width, height, and hot-spot information if applicable.
USAGE WITH STANDARD STREAMS
As with many Netpbm utilities, `pbmtox10bm` supports reading from standard input and writing to standard output. This allows for powerful piping operations. For example, `convert input.jpg - | ppmtopbm | pbmtox10bm > output.x10bm` (assuming `convert` outputs to stdout in a format Netpbm understands, then piped through `ppmtopbm` to get a PBM, then to `pbmtox10bm` to get the final X10 bitmap).
HISTORY
`pbmtox10bm` is part of the Netpbm project, which originated from Jef Poskanzer's Pbmplus toolkit in the late 1980s. Pbmplus was designed to convert between various image formats and included tools for manipulating basic bitmap, grayscale, and pixmap files. As the X Window System evolved, so did its associated bitmap formats. `pbmtox10bm` specifically addresses the needs of the older X10 environment, reflecting a period before X11 became the dominant X Window System version. Its continued presence in the Netpbm suite highlights the project's commitment to maintaining compatibility with a wide range of legacy and niche graphics formats.