Image Protocol
Plots, screenshots, and diagrams. Right in your terminal. No window switching required.
Questions this answers
- How to display images in the terminal on macOS
- iTerm2 image protocol support in other terminals
- Sixel graphics terminal emulator macOS
- Show inline images in terminal for data science workflows
How it works
Chau7 supports two inline image protocols. The iTerm2 image protocol uses an OSC 1337 escape sequence to transmit a base64-encoded image (PNG, JPEG, GIF, or PDF) that the terminal renders inline at the cursor position. The image is decoded on a background thread and uploaded to a Metal texture for GPU-composited display alongside text content.
Sixel graphics support allows programs that output Sixel-encoded raster data (common in scientific computing and retro computing tools) to render images directly in the terminal grid. Chau7 decodes the Sixel color registers and pixel data into an RGBA bitmap that is composited into the terminal framebuffer at the correct cell position.
Both protocols respect the terminal grid: images occupy a calculated number of character cells based on their pixel dimensions and the current cell size. Scrollback preserves images, so they remain visible when scrolling up through previous output. Images are memory-mapped and released when they scroll out of the scrollback buffer.
Why it matters
Data science, DevOps, and design workflows produce visual output: matplotlib charts, architecture diagrams, CI status badges. Chau7 supports inline image rendering via the iTerm2 image protocol, so you can display images directly in terminal output without switching to another application.
Frequently asked questions
Which image formats are supported?
The iTerm2 protocol supports PNG, JPEG, GIF (including animated GIF), BMP, TIFF, and PDF. Sixel graphics produce raster output at the resolution specified by the Sixel data stream.
Do images survive scrollback?
Yes. Images are stored in the scrollback buffer alongside text content and remain visible when you scroll up. They are released from memory only when they exit the scrollback limit.
Can I use imgcat or similar tools with Chau7?
Yes. Any tool that outputs iTerm2 image protocol sequences works with Chau7 out of the box, including imgcat, viu, timg, and catimg.