Skip to content

feat: add terminal image output utilities (Kitty + half-block truecolor)#10

Open
mtao wants to merge 1 commit intomainfrom
feature/terminal-mesh-viewer
Open

feat: add terminal image output utilities (Kitty + half-block truecolor)#10
mtao wants to merge 1 commit intomainfrom
feature/terminal-mesh-viewer

Conversation

@mtao
Copy link
Copy Markdown
Owner

@mtao mtao commented Apr 10, 2026

Summary

  • Add balsa::terminal module in core/ with three image emission methods for rendering images directly in the terminal
  • emit_kitty(): Kitty graphics protocol for pixel-perfect display (Kitty/Ghostty/WezTerm)
  • emit_halfblock(): Unicode half-block chars with 24-bit ANSI truecolor (universal fallback)
  • emit_auto(): auto-detect terminal and pick the best method

Details

New files:

  • core/include/balsa/terminal/image_output.hpp — public API declarations
  • core/src/terminal/image_output.cpp — implementation (base64 encoder, Kitty protocol chunking, half-block rendering, TERM_PROGRAM detection)

This module is used by ART's art_term tool (see AnotherRayTracer PR) to display ray-traced mesh images in the terminal.

Add balsa::terminal module with three emission methods:
- emit_kitty(): Kitty graphics protocol (Kitty/Ghostty/WezTerm)
- emit_halfblock(): Unicode half-block chars with 24-bit ANSI truecolor
- emit_auto(): auto-detect and pick the best method

Includes base64 encoder for Kitty protocol payload and TERM_PROGRAM-based
capability detection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant