Skip to main content

Module graphics

Module graphics 

Source
Expand description

Inline graphics encoders for DCS and APC image protocols.

§Category

This module frames image payloads as either Sixel DCS strings or APC graphics strings. It does not inspect, compress, or validate the image payload itself.

§String-control framing

Both writers use 7-bit string controls terminated by ST (ESC \\):

ESC P ... q payload ESC \\     DCS Sixel
ESC _ G opts ; payload ESC \\  APC graphics
──┬──                 ──┬──
intro               terminator

§Mode interaction

Inline graphics are not toggled by a mode in this module. Terminals may impose their own size, capability, or security policy on received payloads.

Functions§

write_kitty_graphics
Frame a graphics payload as ESC _ G <options> [;<payload>] ESC \.
write_sixel
Frame a Sixel payload as ESC P <p1> ; <p2> [;<p3>] q <payload> ESC \.