Skip to content

Images

Otty supports inline images via two protocols: iTerm2's OSC 1337 and the Kitty graphics protocol.

images in bilibili-tui

iTerm2 protocol (OSC 1337)

Send a base64-encoded PNG / JPEG / GIF inline. Simplest usage:

bash
imgcat ./icon.png         # imgcat ships with iTerm2 utilities; also works in Otty

Or manually:

bash
printf '\e]1337;File=inline=1:%s\a' "$(base64 < ./icon.png)"

Supported parameters: inline, name, size, width, height, preserveAspectRatio.

Kitty graphics protocol

The richer of the two — supports placement at cursor, cell-based sizing, z-index, replacement, and deletion by ID.

bash
kitty +kitten icat ./preview.png    # any Kitty-compatible viewer

What Otty implements today:

FeatureStatus
Transmission: direct (t=d)
Transmission: file (t=f / t=t)
Transmission: chunked, zlib
Transmission: shared memory (t=s)planned
Formats: RGB, RGBA, PNG
Placement (cursor, cell size, z-index, placement ID)
Management (delete by id / placement / all, replace)
Query / capability response (a=q)
Unicode placeholders (U+10EEEE virtual placement)
Animation (multi-frame, playback control)planned
Relative placement (parent-child chains)planned

Sixel

Status: planned. The bitmap-strip protocol used by lsix, chafa, mpv -vo sixel.

Performance notes

  • Images are uploaded once per ID and reused, even after clear.
  • A small atlas caches recently-seen images; very large or rare images bypass.
  • printf -based images larger than ~5 MB encoded should use chunked or file mode.

See also

Otty