Glyphix is a terminal-based GIF renderer written in Rust that converts animated GIFs into ASCII and plays them directly in the terminal.
It implements a full decoding pipeline including frame compositing, transparency handling, and disposal methods to closely match actual GIF playback behavior.
Glyphix is designed as a low-level exploration of image processing, terminal rendering, and systems programming in Rust.
Instead of treating GIFs as static images, Glyphix correctly reconstructs each frame by:
- Decoding raw GIF frames
- Applying frame offsets within a logical canvas
- Respecting alpha transparency
- Handling disposal methods (
Keep,Background, partial support forPrevious) - Converting composited frames into ASCII representation
- Rendering animated output in the terminal with proper timing
- GIF metadata inspection
- Frame-level decoding and compositing
- ASCII conversion based on luminance
- Terminal animation playback
- CLI-based workflow
git clone https://github.com/<your-username>/glyphix.git
cd glyphix
cargo build --releaseBinary will be available at:
target/release/glyphix
Usage:
- Inspect GIF metadata
glyphix inspect <path-to-gif>Outputs:
- Canvas dimensions
- Frame count
- Repeat behavior
- Total duration
- Render first frame : Displays the first frame as ASCII.
glyphix frame <path-to-gif>- Play animation: Renders the full animation in the terminal once.
glyphix play <path-to-gif>More commands coming soon...
1. Frame Compositing
- GIF frames are not always full images. Many are partial updates positioned using offsets.
- Glyphix reconstructs the final image by drawing each frame onto a persistent canvas.
2. Transparency (Alpha Channel) : Each pixel contains an alpha value:
0→ fully transparent (ignored)255→ fully visible- Transparent pixels do not overwrite existing canvas data.
3. Disposal Methods : Each frame specifies how the canvas should be updated after rendering:
Keep→ retain frameBackground→ clear frame regionPrevious→ partially supported (coming soon...)
4. ASCII Mapping
- Pixel brightness is computed using Standard Luminance Formula:
0.299R + 0.587G + 0.114B - Mapped to a character set:
@%#*+=-:.
- clap — CLI argument parsing
- gif — GIF decoding and frame handling
- image — image processing utilities
- crossterm — for terminal rendering and control
- anyhow — ergonomic error handling
- Full disposal method support
- ANSI color output
- Performance optimizations for large GIFs
- Configurable ASCII character sets
- Resize and scaling options
- Partial support for
DisposalMethod::Previous - No color rendering (grayscale ASCII only)
- Performance not optimized for large GIFs
- Export ASCII animation frames (JSON/Lua) for external integrations
- Experimental Neovim dashboard integration for animated ASCII rendering
- Terminal-based dashboards and UI integrations
- ASCII preview generation for developer tooling and demos
- Lightweight animation rendering for remote/SSH environments