Skip to content

Epistates/figif

figif

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.

Crates.io Rust CI License: MIT/Apache-2.0

Features

  • Perceptual Analysis: Uses image hashing (dHash, pHash, BlockHash) to group frames into semantic "segments" (pauses vs. motion).
  • SOTA Compression: Integrated with gifski for 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.

Project Structure

  • 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.

Getting Started

Installation

cargo install --path crates/figif-cli
cargo install --path crates/figif

CLI Usage

Analyze a GIF and show segment breakdown:

figif-cli analyze demo.gif

Optimize 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.gif

TUI Usage

Launch the interactive suite:

figif path/to.gif

Keybindings:

  • j/k: Navigate segments
  • Enter: Zoom into frames of a segment
  • p: Toggle playback preview
  • c: Cap segment duration
  • x: Clear operations
  • s: Save/Export optimized GIF

Development

Testing

Run the full suite of unit and integration tests:

cargo test --all-targets --all-features

Fuzzing

Ensure decoder robustness against malformed inputs:

cargo +nightly fuzz run fuzz_decoder

License

This project is licensed under either the MIT License or the Apache License 2.0.

About

figif is a GIF manipulation suite designed for intelligent frame analysis and optimization

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages