A high-performance, 100% pure Rust implementation of SIXEL graphics encoding and decoding.
SIXEL (Six Pixels) is a bitmap graphics format for terminals, originally developed by DEC for the VT200 series terminals in the 1980s. It allows displaying images directly in terminal emulators that support the format.
Modern terminals with SIXEL support include:
- xterm (with
+sixelbuild option) - mlterm, foot, WezTerm, Contour, ctx, and many more
This repository contains two crates:
icy_sixel - Library
The core Rust library for encoding and decoding SIXEL graphics.
cargo add icy_sixelFeatures:
- High-quality color quantization (Wu's algorithm + Floyd-Steinberg dithering)
- SIMD-accelerated decoder
- Full transparency support
- Configurable pixel aspect ratio and background mode
- No C dependencies
icy_sixel-cli - Command-Line Tool
A CLI for converting images to/from SIXEL and playing animated GIFs.
cargo install icy_sixel-cliCommands:
sixel encode- Convert PNG/JPEG/GIF/WebP to SIXELsixel decode- Convert SIXEL back to PNGsixel animate- Play animated GIFs in the terminal
use icy_sixel::{sixel_encode, EncodeOptions};
let rgba = vec![255, 0, 0, 255]; // Red pixel
let sixel = sixel_encode(&rgba, 1, 1, &EncodeOptions::default())?;
print!("{}", sixel);# Display image in terminal
sixel encode image.png
# Play animated GIF
sixel animate animation.gif
# Convert SIXEL to PNG
sixel decode image.six -o output.pnggit clone https://github.com/mkrueger/icy_sixel
cd icy_sixel
# Build everything
cargo build --release
# Run tests
cargo test
# Run benchmarks
cargo benchLicensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.