pbmtoplot
Convert PBM image to HP-GL plotter format
TLDR
Convert a PBM image into a UNIX plot file
SYNOPSIS
pbmtoplot
DESCRIPTION
pbmtoplot is a utility from the Netpbm toolkit, designed to transform a Portable BitMap (PBM) image file into a vector graphics file in the plot(5) format.
The plot(5) format is a simple, ASCII-based representation primarily used for early Unix plotting devices. It describes graphics using basic drawing commands like lines, points, and arcs. pbmtoplot converts each pixel of the input bitmap into corresponding vector commands, effectively drawing the bitmap on a plotter.
This command is particularly useful for sending raster images to plotters that understand the plot(5) language, or for integrating bitmap data into existing plot(5)-based workflows. By default, it reads PBM data from standard input and writes the plot(5) output to standard output.
CAVEATS
File Size: Converting a raster image like PBM to the plot(5) vector format can result in very large output files, especially for high-resolution bitmaps, as each pixel often translates into individual drawing commands.
Format Limitations: The plot(5) format is relatively old and simple, lacking modern vector graphics features. It's primarily suited for basic line and point drawing.
Output Quality: The visual quality of the output depends heavily on the capabilities and resolution of the plotting device interpreting the plot(5) data.
STANDARD I/O USAGE
pbmtoplot operates as a filter. It reads PBM data from standard input (stdin) and writes the resulting plot(5) data to standard output (stdout). This allows it to be easily integrated into pipelines.
Example:
cat image.pbm | pbmtoplot > image.plot
HISTORY
pbmtoplot is part of the Netpbm project, a comprehensive toolkit for manipulating graphics images. Netpbm originated from the PBMplus package, created by Jef Poskanzer in the late 1980s. The plot(5) format itself dates back to early Unix systems, used for simple graphical output on plotters and terminals. pbmtoplot bridges the gap between bitmap images and this older vector graphics standard, reflecting a period when dedicated plotters were common output devices.