pbmtoepsi
Convert PBM image to EPSI format
TLDR
Convert a PBM image to an encapsulated PostScript style preview bitmap
Produce a quadratic output image with the specified resolution
Produce an output image with the specified horizontal and vertical resolution
Only create a boundary box
SYNOPSIS
pbmtoepsi [-r|-p] [-b x y] [-s w h] [-g number] [-v] [pbmfile]
PARAMETERS
-r or --raster
Generates a raster-based EPSI file. This is the default behavior
for modern versions of pbmtoepsi and is generally more efficient,
producing smaller files as it uses the PostScript image
operator to draw the bitmap.
-p or --path
Generates a path-based EPSI file. This method draws each pixel
as a filled path, which can result in extremely large and slow-rendering
PostScript files, especially for high-resolution images. This option
is largely superseded by the raster method and is generally not recommended
unless specific compatibility with older software is required.
-b x y or --bbox-ul x y
Specifies the upper-left corner of the bounding box for the
PostScript output in points (1/72 inch). Defaults to 0 0 if not specified.
-s w h or --bbox-size w h
Specifies the width and height of the bounding box for the
PostScript output in points. Defaults to the input image's actual
dimensions if not specified.
-g number or --grid number
Inserts an Aldus-specific comment {{grid number}}
into the
EPSI output. This option is for compatibility with older Aldus applications
that may interpret this comment for layout purposes.
-v or --verbose
Displays verbose information about the conversion process to
standard error, such as the chosen output method and bounding box dimensions.
pbmfile
The path to the input PBM file. If this argument is omitted,
pbmtoepsi reads the Portable Bitmap data from standard input.
DESCRIPTION
pbmtoepsi is a Netpbm utility that converts a
Portable Bitmap (PBM) image file into an Encapsulated PostScript Interchange (EPSI) file.
EPSI files are a specific type of PostScript file that includes a low-resolution
bitmap preview. This preview allows applications to display a rough
representation of the image without needing to fully interpret the PostScript code,
making it useful for layout programs. By default, pbmtoepsi generates a
raster-based EPSI, meaning the PostScript output uses the 'image' operator to
render the bitmap efficiently. It operates on black and white PBM images only;
for other Netpbm formats (PGM, PPM) or more advanced PostScript output,
other tools like pnmtops might be required. It reads from standard input
if no file is specified, and writes the EPSI output to standard output.
CAVEATS
pbmtoepsi is designed exclusively for Portable Bitmap (PBM)
images, meaning it can only process black and white images. For grayscale
(PGM) or color (PPM) images, or for more general PostScript output options,
users should instead consider commands like pnmtops from the Netpbm suite.
The -p (path) option can produce significantly larger and less efficient
EPSI files compared to the default -r (raster) option, and its use is
generally discouraged unless specific compatibility needs dictate.
EPSI is an older format; for modern workflows, plain EPS or PDF
are more commonly used for embedding images.
STANDARD INPUT/OUTPUT
When no pbmfile is specified, pbmtoepsi implicitly
reads its Portable Bitmap input from standard input (stdin).
The generated Encapsulated PostScript Interchange data is always
written to standard output (stdout).
BOUNDING BOX AND SCALING
The bounding box parameters (-b for upper-left corner
and -s for size) are crucial for defining how the image
is placed and scaled within a PostScript document. These values
are specified in PostScript points (1/72 inch). Correctly setting
these parameters ensures that the embedded image appears at the
desired position and scale when included in a larger document layout.
HISTORY
pbmtoepsi is a long-standing component of the Netpbm project,
a comprehensive and open-source toolkit for manipulating graphics images
in various formats. Historically, the path-based PostScript output (-p)
was more prevalent, but with advancements in PostScript interpreters and
the need for more compact and faster-rendering files, the default behavior
shifted to raster-based output (-r) starting from Netpbm version 10.32.
This change reflected a move towards more efficient bitmap embedding practices.