ReadonlyheightImage height in pixels (number of rows).
ReadonlywidthImage width in pixels.
ReadonlywidthNumber of bytes required to represent one row of pixels.
Equals Math.ceil(width / 8).
Split the image into vertical fragments of at most fragmentHeight rows.
Used by Escpos.image() to avoid printer buffer overruns on large images.
Maximum number of rows per fragment.
Array of EscposImage slices (last slice may be shorter).
Yield column data buffers for ESC * column-format printing.
Each yielded Buffer represents the vertical byte-strip for one pixel column. Bits are packed top-to-bottom, MSB at the top.
The number of bytes per column depends on highDensity:
Escpos.image() wraps these blobs with the ESC * header and line-feed
when impl === 'bitImageColumn'.
true for 24-dot high-density mode, false for
8-dot low-density mode. Defaults to false.
Encode the image as a raw ESC/POS raster data payload (pixel bytes only,
no GS v 0 header).
Layout: row-major, MSB-first within each byte.
widthBytes × height bytes.The caller is responsible for prepending the GS v 0 command header.
Escpos.image() handles this internally when impl === 'bitImageRaster'.
Raw pixel data buffer.
StaticloadLoad an image from a file path or raw image Buffer (PNG, BMP, JPEG, GIF, TIFF).
The image is:
Absolute file path or raw image file Buffer.
A resolved EscposImage instance.
An image loaded from a file path or raw Buffer, pre-processed into a two-dimensional boolean pixel grid ready for ESC/POS encoding.
Dark pixel →
trueLight pixel →falseSince
1.0.0