Overview
Sixel is a bitmap graphics format that allows terminals to display images inline. tmux includes comprehensive sixel support when compiled with the appropriate libraries, enabling image display in panes.Sixel Protocol
Image Format
Fromimage-sixel.c:26-54, sixel images are represented internally as:
Sixel Line Structure
Fromimage-sixel.c:29-32:
Terminal Feature
Fromtty-features.c:350-358, enable sixel support:
Configuration
~/.tmux.conf
Sixel Parsing
Image Sequence Format
Fromimage-sixel.c:299-354, sixel sequences start with:
\033P- DCS (Device Control String) introducer<parameters>- Optional parametersq- Sixel command<sixel-data>- Encoded image data\033\\- ST (String Terminator)
Sixel Parser
Fromimage-sixel.c:299-362, the parser handles:
Sixel Commands
- Raster Attributes
- Color Definition
- Repeat Sequence
- Sixel Data
From Where:Defines an 800x600 image with 1:1 aspect ratio.
image-sixel.c:143-193, define image dimensions:Pan: Pixel aspect ratio numeratorPad: Pixel aspect ratio denominatorPh: Horizontal size in pixelsPv: Vertical size in pixels
Image Size Limits
Fromimage-sixel.c:26-27:
- Maximum width: 10,000 pixels
- Maximum height: 10,000 pixels
image-sixel.c:70-78 and 82-92:
Image Scaling
Fromimage-sixel.c:416-484, images can be scaled to fit terminal cells:
Cell Size Calculation
Fromimage-sixel.c:403-414:
Sixel Output
Fromimage-sixel.c:571-656, generating sixel sequences:
Compression
Fromimage-sixel.c:520-569, sixel data is run-length encoded:
Displaying Images
Screen Conversion
Fromimage-sixel.c:658-690, convert sixel to tmux screen:
Debugging Sixel
Fromimage-sixel.c:377-401, log sixel image details:
Supported Terminals
Terminals with sixel support:xterm
Built-in sixel support (configure with
--enable-sixel-graphics).mlterm
Native sixel support, optimized for performance.
foot
Modern Wayland terminal with sixel support.
WezTerm
Cross-platform terminal with sixel support.
kitty
Supports kitty graphics protocol (not sixel) but has sixel compatibility mode.
iTerm2
Supports inline images protocol (not sixel directly).
Image Tools
Convert images to sixel:
Image viewers:
- lsix: Thumbnail browser using sixel
- viu: Image viewer for terminals
- chafa: Versatile image-to-text converter with sixel support
Limitations
- Color depth: Limited to 256 colors typically (though some terminals support more)
- Memory usage: Large images consume significant memory
- Performance: Rendering can be slow for complex images
- Terminal compatibility: Not all terminals support sixel
- tmux limitations: Images may not persist across redraws in all situations
image-sixel.c:210-215:
Best Practices
Use appropriate image sizes - don’t exceed terminal dimensions
Limit color palette to 256 colors for best compatibility
Test sixel support before deploying image-heavy applications
Provide text fallbacks for terminals without sixel support
Related Configuration
terminal-features- Enable sixel capabilitydefault-terminal- Terminal type
Resources
- VT340 Programmer Reference - Original sixel documentation
- libsixel - Sixel encoder/decoder library
- Sixel Graphics Wikipedia - Protocol overview