# quad-gif
[](https://github.com/ollej/quad-gif/actions/workflows/crosscompile.yml) [](https://crates.io/crates/quad-gif) [](https://docs.rs/quad-gif/latest/quad_gif/) [](https://opensource.org/licenses/MIT)
Display looping GIF animations with Macroquad.
The animation will loop forever, regardless of how many iterations are set in
the file.
[Documentation](https://docs.rs/quad-gif/latest/quad_gif/) on docs.rs
## Usage
There is a binary file included that can be used to show a GIF file.
```
Display GIF animations with Macroquad.
Usage: quad_gif [OPTIONS] [FILENAME]
Arguments:
[FILENAME] Filename of the GIF [default: animation.gif]
Options:
-f, --filter-mode <FILTER_MODE> Which filter mode to use [default: linear] [possible values: linear, nearest]
-h, --help Print help
-V, --version Print version
```
## API usage
The library can be used in a Macroquad application to show an animation.
```rust
use macroquad::prelude::*;
use quad_gif;
#[macroquad::main("quad-gif")]
async fn main() {
let mut animation = quad_gif::GifAnimation::load("animation.gif".to_string()).await;
clear_background(WHITE);
loop {
animation.draw();
animation.tick();
next_frame().await
}
}
```
## License
Copyright 2026 Olle Wreede, released under the MIT License.
## Attribution
Animated Ferris in Action by A. L. Palmer
Happy as a Rustacean at Rust Fest Berlin 2016 (www.rustfest.eu)