Image helper¶
Module escpos.image
Image format handling class
This module contains the image format handler EscposImage
.
- author
- organization
- copyright
Copyright (c) 2016 Michael Billington <michael.billington@gmail.com>
- license
MIT
- class escpos.image.EscposImage(img_source)[source]¶
Bases:
object
Load images in, and output ESC/POS formats.
The class is designed to efficiently delegate image processing to PIL, rather than spend CPU cycles looping over pixels.
- property width¶
Width of image in pixels
- property width_bytes¶
Width of image if you use 8 pixels per byte and 0-pad at the end.
- property height¶
Height of image in pixels
- to_column_format(high_density_vertical=True)[source]¶
Extract slices of an image as equal-sized blobs of column-format data.
- Parameters
high_density_vertical – Printed line height in dots