Skip to main content

Tiny kitty graphics protocol PNG renderer using Unicode placeholders

Project description

kittytgp

kittytgp is a small pure-Python package that renders a PNG with kitty's graphics protocol using Unicode placeholders (U+10EEEE).

It follows kitty's tmux/editor-friendly placeholder flow:

  1. transmit PNG data with kitty graphics protocol
  2. create a virtual placement with U=1
  3. print U+10EEEE placeholder text colored with the image ID

Because the visible part is ordinary Unicode text, the image moves with the text buffer and works inside hosts such as tmux.

Install

pip install kittytgp

CLI

kittytgp plot.png

Useful options:

kittytgp plot.png --cols 40
kittytgp plot.png --rows 20
kittytgp plot.png --cell-size 10x20
kittytgp plot.png --image-id 0x123456
kittytgp plot.png --no-newline

Python API

from kittytgp import render_png

render_png("plot.png")

Or build the bytes yourself:

from kittytgp import build_render_bytes

payload = build_render_bytes("plot.png")

Design notes

This package intentionally stays small:

  • PNG input only
  • direct transfer (f=100 PNG payload in APC chunks)
  • Unicode placeholders only
  • 24-bit image IDs encoded in truecolor foreground color
  • tmux passthrough only when needed

By default it fits the image into the current terminal while preserving aspect ratio. If the terminal cannot report cell pixel size, pass --cell-size, --cols, or --rows.

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

kittytgp-0.0.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

kittytgp-0.0.2-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file kittytgp-0.0.2.tar.gz.

File metadata

  • Download URL: kittytgp-0.0.2.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for kittytgp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 295f9cd4ae9c9a701106860e370037a117c8cb8839f1d639badbba5d4dde5838
MD5 5bddfe70f7f8227e63e1067187010ffd
BLAKE2b-256 ea1d99145a25f1998b1c58ca8734d198868667d7d4d1c5b5079549b4da668285

See more details on using hashes here.

File details

Details for the file kittytgp-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: kittytgp-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for kittytgp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0121a57446079f405824c3604beaa88583dbecd031953cbb755db2fb6d0525cf
MD5 3ef523aa67ffe405eaf63cfd9d9c5b7a
BLAKE2b-256 035415d79ee63b06dc811ba4155e0a114cfc1573aecd670272ff215c8d80a68f

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