Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixijs/gif
Plugin to support playback of animated GIF images in PixiJS.
https://github.com/pixijs/gif
animation gif pixijs
Last synced: 5 days ago
JSON representation
Plugin to support playback of animated GIF images in PixiJS.
- Host: GitHub
- URL: https://github.com/pixijs/gif
- Owner: pixijs
- License: mit
- Created: 2021-11-09T17:14:18.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T10:14:58.000Z (7 months ago)
- Last Synced: 2024-10-29T21:06:13.182Z (17 days ago)
- Topics: animation, gif, pixijs
- Language: TypeScript
- Homepage: https://pixijs.io/gif/docs/
- Size: 3.13 MB
- Stars: 41
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PixiJS Animated GIF
[![Node.js CI](https://github.com/pixijs/gif/actions/workflows/nodejs.yml/badge.svg?branch=main)](https://github.com/pixijs/gif/actions/workflows/nodejs.yml)
Plugin to support playback of animated GIF images in PixiJS. Unlike normal GIF playback in the browser, this plugins allows you to stop, loop, change speed, or go to a specific frame.
* [Demo](https://pixijs.io/gif/examples/)
* [API Documentation](https://pixijs.io/gif/docs/)## Usage
Load an animated GIF image with Assets:
```ts
import '@pixi/gif';
import { Assets } from 'pixi.js';const app = new Application();
const image = await Assets.load('image.gif');
app.stage.addChild(image);
```To use a gif without Assets:
```ts
import { Application } from 'pixi.js';
import { AnimatedGIF } from '@pixi/gif';const app = new Application();
fetch('image.gif')
.then(res => res.arrayBuffer())
.then(AnimatedGIF.fromBuffer)
.then(image => app.stage.addChild(image));
```### Version Compatiblity
| PixiJS | PixiJS GIF |
|--------|------------|
| v6.x | v1.x |
| v7.x | v2.x |
| v8.x | v3.x |