wtrenderlib
Dependency-free Rust primitives for rendering RGB/RGBA image frames in terminals.
The default build has no normal dependencies and accepts decoded frames through
FrameView. It includes:
- ANSI truecolor Unicode half-block and quadrant rendering
- Kitty graphics protocol rendering
- iTerm2 inline image protocol for caller-provided encoded images
- Optional Sixel encoding (
--features sixel) - tmux/screen DCS passthrough wrapping helpers
- Optional external
ffmpegraw-video frame source - Optional
imageadapter (pngandjpegonly)
The library deliberately does not expose a file decoder type in its core API. Applications can choose their own decoder and pass borrowed pixel buffers without converting them to a common image crate.
use ;
use ;
let pixels = ;
let frame = new?;
let mut output = stdout;
render_unicode?;
# Ok::
Enable the optional image adapter with --features image. Video decoding is
kept outside the Rust dependency graph and can use FfmpegSource when the
ffmpeg executable is installed.
For iTerm2-compatible terminals, pass encoded PNG/JPEG bytes to
render::render_iterm2; the core intentionally does not add an image encoder
just to produce this protocol.
Sixel support is opt-in because it adds the icy_sixel dependency:
cargo run --features sixel --example render_raw
When a graphics protocol is used inside tmux or screen, wrap the generated
sequence with render::write_passthrough and the appropriate
render::Multiplexer variant.
Compatibility notes and a reproducible local benchmark are in
docs/compatibility.md.