Project 11: Sixel/Image Protocol Support

Support for inline images in your terminal using Sixel graphics, Kitty graphics protocol, or iTerm2 inline images.

Quick Reference

Attribute Value
Primary Language C
Alternative Languages Rust, Go
Difficulty Level 3: Advanced (The Engineer)
Time Estimate 2-3 weeks
Knowledge Area Graphics Protocols / Terminal Extensions
Tooling Image Terminal
Prerequisites Project 7

What You Will Build

Support for inline images in your terminal using Sixel graphics, Kitty graphics protocol, or iTerm2 inline images.

Why It Matters

This project builds core skills that appear repeatedly in real-world systems and tooling.

Core Challenges

  • Sixel parsing → Old DEC standard, still widely supported
  • Kitty protocol → Modern, efficient, uses base64 + chunks
  • iTerm2 protocol → OSC-based, proprietary but common
  • Image placement → Fitting images into cell grid
  • Memory management → Images can be large

Key Concepts

Real-World Outcome

$ ./image_terminal

# Display image using kitty protocol
$ kitty +kitten icat photo.png
[IMAGE] Received 1920x1080 image via Kitty protocol
[IMAGE] Scaling to 80x24 cells
# Image displays in terminal!

# Or sixel
$ img2sixel photo.png
[IMAGE] Parsing Sixel data...
[IMAGE] 320x200 image rendered

Implementation Guide

  1. Reproduce the simplest happy-path scenario.
  2. Build the smallest working version of the core feature.
  3. Add input validation and error handling.
  4. Add instrumentation/logging to confirm behavior.
  5. Refactor into clean modules with tests.

Milestones

  • Milestone 1: Minimal working program that runs end-to-end.
  • Milestone 2: Correct outputs for typical inputs.
  • Milestone 3: Robust handling of edge cases.
  • Milestone 4: Clean structure and documented usage.

Validation Checklist

  • Output matches the real-world outcome example
  • Handles invalid inputs safely
  • Provides clear errors and exit codes
  • Repeatable results across runs

References

  • Main guide: TERMINAL_EMULATOR_DEEP_DIVE_PROJECTS.md
  • N/A (protocol specifications)