figif is a GIF manipulation suite designed for intelligent frame analysis and optimization. Built in Rust with a focus on performance, perceptual correctness, and high-quality encoding.
- Perceptual Analysis: Uses image hashing (dHash, pHash, BlockHash) to group frames into semantic "segments" (pauses vs. motion).
- SOTA Compression: Integrated with
gifskifor industry-leading lossy LZW compression. - Parallel Processing: High-performance frame hashing and processing powered by
rayon. - Premium TUI: A hardware-accelerated terminal interface for interactive GIF exploration and optimization.
- Fluent API: A chainable Rust DSL for complex filtering and optimization logic.
- Quality Assurance: Continuous fuzzing, exhaustive integration testing, and strict CI enforcement.
figif-core: The heart of the suite. Handles decoding, analysis, segment detection, and re-encoding.figif-cli: Headless CLI for automation and batch processing.figif: Interactive terminal UI for granular control.
cargo install --path crates/figif-cli
cargo install --path crates/figifAnalyze a GIF and show segment breakdown:
figif-cli analyze demo.gifOptimize a GIF by capping pauses to 300ms and speeding up motion by 1.2x:
figif-cli optimize demo.gif --cap 300 --speed 1.2 -o optimized.gifLaunch the interactive suite:
figif path/to.gifKeybindings:
j/k: Navigate segmentsEnter: Zoom into frames of a segmentp: Toggle playback previewc: Cap segment durationx: Clear operationss: Save/Export optimized GIF
Run the full suite of unit and integration tests:
cargo test --all-targets --all-featuresEnsure decoder robustness against malformed inputs:
cargo +nightly fuzz run fuzz_decoderThis project is licensed under either the MIT License or the Apache License 2.0.