Documentation
¶
Overview ¶
Package kitty encodes images as Kitty graphics protocol escape sequences with Unicode placeholders, so cell-based TUIs can treat an image as ordinary text. Supported by kitty and Ghostty.
Usage: write TransmitPNG then Place to the terminal once, and print the Placeholder text wherever the image should appear; the terminal draws the image over those cells. Write Delete when done.
Index ¶
Constants ¶
const MaxID = 0xFFFFFF
MaxID is the largest usable image id: placeholder cells encode the id in a 24-bit foreground color.
const MaxSpan = len(diacritics)
MaxSpan is the largest placement size, in rows or columns, addressable by placeholder diacritics.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete returns the escape sequence that removes the image's placements and frees its stored data.
func Place ¶
Place returns the escape sequence that creates a virtual (U=1) placement of the transmitted image, scaled to rows x cols cells. The placement renders wherever Placeholder text for the same id is printed.
func Placeholder ¶
Placeholder returns rows lines of placeholder cells for the image id. Each cell is U+10EEEE with diacritics naming its row and column and a foreground color encoding the id; the terminal draws the matching virtual placement over these cells wherever they appear. Every cell is fully addressed, so lines survive partial repaints and reordering.
Types ¶
This section is empty.