Skip to main content

Print images to Epson TM-T88V thermal printer via ESC/POS (direct to device, no CUPS)

Project description

tmt88v-print-py

Epson TM-T88V

Print images to Epson TM-T88V thermal printer (80 mm) via ESC/POS. Sends data directly to the device (e.g. /dev/usb/lp2), no CUPS/lp.

  • Resolution: 512 dots (72 mm printable width), configurable.
  • Resize: width, fit (inside | fill | stretch), optional height.
  • Binarization: threshold (default) or dither: none, floyd-steinberg, ordered, atkinson.
  • Chunked printing for tall images (default 400 px strips).

Install

pip install tmt88v-print-py

CLI

# Print to default device (/dev/usb/lp2)
tmt88v-print-py image.png

# Custom device
tmt88v-print-py image.png --device /dev/usb/lp0

# Save ESC/POS to file
tmt88v-print-py image.png --output out.bin

# Width 384 (58 mm), Floyd–Steinberg dither
tmt88v-print-py photo.jpg --width 384 --dither floyd-steinberg

# Options: --chunk, --width, --fit, --dither, --threshold

Use sudo if needed: sudo tmt88v-print-py image.png

Local testing (no printer)

Generate a sample image and write ESC/POS to a file:

pip install -e .
python examples/generate_sample.py
tmt88v-print-py examples/sample.png --output examples/out.bin

See examples/README.md for more options and API usage.

API

from tmt88v_print import image_to_escpos, print_image

# Get ESC/POS bytes
data = image_to_escpos("image.png", chunk_height=400, width=512, dither="none")
with open("/dev/usb/lp2", "wb") as f:
    f.write(data)

# Or print directly
print_image("image.png", device="/dev/usb/lp2", chunk_height=400)

Author

Pietro LeoniGitHub · pietro.leoni@gmail.com

License

MIT – see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tmt88v_print_py-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tmt88v_print_py-1.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file tmt88v_print_py-1.0.0.tar.gz.

File metadata

  • Download URL: tmt88v_print_py-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tmt88v_print_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 94b9d6020913353af53e9ce6bf2802cbec1c5c650595cc15a7b33666e0a85828
MD5 8e1f4b79117c8405f915fa37e8799c94
BLAKE2b-256 d601417a5a0806c76572cf5b8d5abae87f3c207edf27b5730f01c20da4391f09

See more details on using hashes here.

File details

Details for the file tmt88v_print_py-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tmt88v_print_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f86bfed5bfcbf443bb6ddd1f6534e043c88d55c1715d2bcd966e87d7d8972207
MD5 d2d062d5248dcadd11ef6dda3aa7c6a5
BLAKE2b-256 ede29079c81a8d3b7697aac0a4f090436138c4928e6c448c01e386c89c6290a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page