PBMTOESCP2(1)
β¨ Pbmtoescp2 User Manual β¨
okay bestie, welcome to the pbmtoescp2 page from the General Commands Manual β yes it's a real manual-page kinda manual, section (1), and it is lowkey iconic π
π NAME π
pbmtoescp2 β convert a PBM image to a ESC/P2 printer file
π¦ SYNOPSIS π¦
pbmtoescp2
[-compress=compressionmode] [-resolution={180|360|720}]
[-stripeheight=n] [-formfeed] [-raw] [pbmfile]
okay so notes on the vibe of this synopsis, bestie, because they matter:
- All options can be abbreviated to their shortest unique prefix. Shortest. Unique. Don't be out here abbreviating ambiguously, it's giving chaos π
- You may use two hyphens instead of one to designate an option.
- You may use either white space or equals signs between an option name and its value.
πΈ DESCRIPTION πΈ
This program is part of Netpbm(1).
pbmtoescp2 reads a PBM image as input. It produces an ESC/P2 raster graphic printer control stream as output.
This program creates an output that is printable on Epson printers that understand the ESC/P2 printer control language (e.g. the Stylus models). For older Epson 9-pin dot matrix printers, which use the ESC/P protocol, see pbmtoepson. (different protocol, different era, we respect the elders π«Ά)
The printed output has one pixel for each pixel of the input image, except that it is padded up to the stripe size (see the -stripeheight option) vertically and to a multiple of 8 columns horizontally. β οΈ Before Netpbm 10.72 (September 2015), the output is instead truncated to those boundaries. so yeah, the timeline changed the whole vibe there.
Input is read from file pbmfile if specified, otherwise from stdin. Output is written to stdout. classic. slay. β¨
π OPTIONS π
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pbmtoescp2 recognizes the following command line options:
-compress=compressionmodeβ This determines the compression mode thatpbmtoescp2uses in its output. Valid values for compressionmode are0and1.-compress=0results in a printer control stream with uncompressed raster graphic data.-compress=1results in a printer control stream with RLE compressed raster graphic data (RLE means Run Length Encoding). The default is-compress=1. π-resolution=dpiβ This determines the horizontal and the vertical print resolution set in the printer control stream. Another way of looking at it is a declaration of what the resolution of the input image is (PBM images don't have inherent resolution, they're just out here vibing with no dpi of their own π). Valid values for dpi are180,360, and720. See hints for more information on this. The default is-resolution=360. β οΈ Before Netpbm 10.72 (September 2015),720is not valid.-stripeheight=nβ This option controls the height in lines of the stripes in the output. The valid stripe heights in the printer language are1,8, and24, but it is capable of expressing any height up to255andpbmtoescp2accepts any value in the range1-255. It issues a warning, though, if you choose something other than1,8, or24. (so it'll do it, it's just gonna side-eye you a lil π₯΄) The default is24. This option was new in Netpbm 10.72 (September 2015). Before that, the stripe size is always24.-formfeedβ This option causespbmtoescp2to place a formfeed command at the end of the output. This option was new in Netpbm 10.72 (September 2015).-rawβ This option causespbmtoescp2to generate only the data blocks. It does not generate printer commands to set up the output (for example, setting the line spacing). You can use this to insert graphics into a larger printer command stream. (nesting. we love a collaboration moment π«Ά) This option was new in Netpbm 10.72 (September 2015).
π HINTS π
RLE compresses very well bitmaps of line drawings, preferably horizontal oriented contents like texts, sheets of music, etc. However, bitmaps derived from photographs are not ideal for RLE. In extreme cases, when no byte repetitions occur in the input, the result will be even slightly bigger than the input π. To avoid this, use compression mode 0 to switch off RLE. noted. no cap.
Each pixel in the input PBM image becomes one dot in the printed output. Therefore, you must make sure the width and height of the input are appropriate for the print resolution you choose and the print area you want. E.g. if you print at 180 dpi and want the image to print as 8 inches by 10, you must supply a PBM that is 1440 pixels wide by 1800 pixels high. You can adjust the size of the input with pamscale, pamstretch, pbmreduce, or pamenlarge. (math checks out bestie, trust β¨)
β SEE ALSO β
escp2topbm(1), pbmtoepson(1), pamscale(1), pamstretch(1), pbmreduce(1), pamenlarge(1), pbm(1)
π AUTHOR π
Copyright (C) 2003 by Ulrich Walcher (u.walcher@gmx.de).
π°οΈ HISTORY π°οΈ
pbmtoescp2 was added to Netpbm in Release 10.18 (August 2003); it was created around the same time. (a legend was born that day fr fr π)
π§ DOCUMENT SOURCE π§
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/pbmtoescp2.html
and that's the whole page, bestie!! this was netpbm documentation, dated 14 July 2015, from the Pbmtoescp2 User Manual (1). go print something cute. periodt π β¨
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms