tui: image rendering — sixel backend #13

Closed
opened 2026-04-11 13:01:09 +00:00 by charles · 0 comments
Owner

User story

As a user on a sixel-capable terminal (xterm -ti 340, mlterm, wezterm, foot), I want loom-tui to display images using the sixel protocol when Kitty is unavailable, so that I still get colour images without falling back to block art.

Acceptance criteria

Sixel renderer

  • SixelRenderer struct implements ImageRenderer (trait from the Kitty ticket)
  • Primary path: use the sixel crate for encoding; fallback: shell out to img2sixel when the crate is unavailable on the target, behind a cargo feature
  • Output clamped to the passed Rect dimensions (respecting terminal cell-to-pixel ratio, queried via crossterm / ioctl TIOCGWINSZ)
  • protocol_name() returns "sixel"
  • Redraws on resize are debounced so scrolling does not flood the terminal
  • Unit test: a fixed 64×64 PNG encodes to a deterministic sixel payload prefix (\x1bPq)

Caching

  • Shares the same (source, width, height) cache key semantics as the Kitty backend
  • Cached sixel bytes reused across frames; eviction on resize

Out of scope

  • Kitty backend (separate ticket)
  • Chafa fallback (separate ticket)
  • Protocol auto-detection (separate ticket)

References

  • Spec §2.2 "Image Rendering Subsystem"
  • DEC Sixel graphics spec
## User story As a user on a sixel-capable terminal (xterm -ti 340, mlterm, wezterm, foot), I want loom-tui to display images using the sixel protocol when Kitty is unavailable, so that I still get colour images without falling back to block art. ## Acceptance criteria ### Sixel renderer - [ ] `SixelRenderer` struct implements `ImageRenderer` (trait from the Kitty ticket) - [ ] Primary path: use the `sixel` crate for encoding; fallback: shell out to `img2sixel` when the crate is unavailable on the target, behind a cargo feature - [ ] Output clamped to the passed `Rect` dimensions (respecting terminal cell-to-pixel ratio, queried via crossterm / `ioctl TIOCGWINSZ`) - [ ] `protocol_name()` returns `"sixel"` - [ ] Redraws on resize are debounced so scrolling does not flood the terminal - [ ] Unit test: a fixed 64×64 PNG encodes to a deterministic sixel payload prefix (`\x1bPq`) ### Caching - [ ] Shares the same `(source, width, height)` cache key semantics as the Kitty backend - [ ] Cached sixel bytes reused across frames; eviction on resize ## Out of scope - Kitty backend (separate ticket) - Chafa fallback (separate ticket) - Protocol auto-detection (separate ticket) ## References - Spec §2.2 "Image Rendering Subsystem" - DEC Sixel graphics spec
charles added this to the loom-tui v0.1.0 milestone 2026-04-11 13:01:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom#13
No description provided.