Docs / Terminal Graphics and Image Rendering (icat)

Terminal Graphics and Image Rendering (icat)

Render inline terminal images and Kitty Graphics on Android using the native icat utility and the bundled preview script.

Native Inline Image Rendering in the Mobile Terminal

Casshper supports high-performance inline image rendering directly in your shell viewport via the Kitty Graphics Protocol, powered by our native Ghostty terminal engine. Rather than relying on bulky external dependencies, Casshper bundles a lightweight, first-party native C utility called icat alongside an interactive terminal diagnostics script (preview.sh).

Zero External Dependencies

The native icat executable is compiled directly into the Casshper Android runtime and linked into your environment's bin/ directory, providing instant, hardware-accelerated image rendering with low memory usage.

Using the icat CLI Tool

The icat command-line utility lets you display local images directly in your active terminal session without opening an external viewer or switching apps:

icat /path/to/image.png
icat ~/photos/diagram.jpg

Key features of icat include:

  • Kitty Graphics Protocol: Streams chunked image payloads directly into the Ghostty terminal canvas for crisp, pixel-accurate rendering.
  • Standard Image Formats: Supports common image formats including PNG and JPEG.
  • Script Compatibility: Includes a backward-compatible kitten wrapper, allowing existing scripts and CLI tools targeting Kitty graphics to work out of the box.

The Bundled Diagnostic Script (preview.sh)

Casshper includes a built-in diagnostics script located at ~/preview.sh in your home directory. This script performs a complete visual audit of your terminal environment:

  • 16-Color ANSI Palette: Displays standard and high-intensity ANSI terminal colors to verify your active color scheme.
  • Color Grid (0–F): Renders background and foreground color matrices across all 256 color combinations.
  • Typography and Font Styles: Previews font rendering across Regular, Bold, Italic, Underline, and Strikethrough styles.
  • Kitty Graphics Test: Automatically invokes icat to render a full-color SMPTE test pattern image, confirming that inline terminal graphics and PTY escape streaming are functioning properly.

To run the preview script at any time in your local shell session, simply type:

~/preview.sh

Common Use Cases for Terminal Graphics

  • CLI Data Visualizations: Inspect generated charts, data science plots, and graphs directly inside your terminal workflow.
  • Asset and Diagram Inspection: Preview diagrams, icons, and UI mockups over SSH or local shells without transferring files to your device photo gallery.
  • Theme and Font Auditing: Quickly verify new terminal themes and font legibility using ~/preview.sh.