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: int
Return width of image in pixels.
- property width_bytes: int
Return width of image if you use 8 pixels per byte and 0-pad at the end.
- property height: int
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 (
bool
) – Printed line height in dots- Return type:
Iterator
[bytes
]