A Rust library for encoding and decoding GIF images.
```rust use gift::Decoder; use std::fs::File; use std::io::BufReader;
let gif = BufReader::new(File::open("example.gif")?); for step in Decoder::new(gif) { // was there a decoding error? let raster = step?.raster(); // ... work with raster } ```
```rust use gift::{Encoder, Step}; use pix::{gray::Gray8, Palette, Raster, rgb::SRgb8}; use std::error::Error; use std::io::Write;
fn encode
NOTE: building a palette from 24- or 32-bit rasters is not yet implemented.
The library comes with a gift
command-line utility, which can show the blocks
within GIF files.
cargo install gift --features=cmd
NOTE: This utility is a work-in-progress, and some features are not implemented.