Table of Contents

Class KittyGraphicsEncoder

Namespace
Terminal.Gui.Drawing
Assembly
Terminal.Gui.dll

Encodes a pixel array into the Kitty terminal graphics protocol APC escape sequence stream.

public class KittyGraphicsEncoder
Inheritance
KittyGraphicsEncoder
Inherited Members

Remarks

The Kitty graphics protocol transmits images via APC sequences of the form: ESC_G <key=value,...>;<base64-data>ESC\.

Images are encoded as raw 32-bit RGBA pixel data (no palette, no quantization), split into chunks of at most MaxChunkSize base64 characters. Multi-chunk transmissions set m=1 on all chunks except the last (m=0).

See https://sw.kovidgoyal.net/kitty/graphics-protocol/ for the full spec.

Constructors

KittyGraphicsEncoder()

Fields

MaxChunkSize

Maximum number of base64-encoded characters per APC chunk. The Kitty protocol recommends ≤4096 bytes of payload per chunk.

Methods

EncodeDeletePlacements(int)

Builds a Kitty graphics protocol APC sequence that deletes all placements of the image with the specified imageId, leaving the transmitted image data intact so it can be re-displayed.

EncodeKitty(Color[,], int, int, int?)

Encodes the provided pixel array into a Kitty graphics protocol APC sequence string that, when written to the terminal, renders the image at the current cursor position occupying destCols columns and destRows rows.

GetImageId(string)

Derives a stable, positive, non-zero Kitty image id from the given string identifier.