https://github.com/samthor/fastgif
fastgif, fast Web Assembly GIF decoder based on Wuffs
https://github.com/samthor/fastgif
gif wasm
Last synced: 10 months ago
JSON representation
fastgif, fast Web Assembly GIF decoder based on Wuffs
- Host: GitHub
- URL: https://github.com/samthor/fastgif
- Owner: samthor
- License: apache-2.0
- Created: 2018-06-27T06:33:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-04T01:12:25.000Z (almost 8 years ago)
- Last Synced: 2025-08-04T21:17:08.944Z (11 months ago)
- Topics: gif, wasm
- Language: HTML
- Homepage:
- Size: 4.38 MB
- Stars: 70
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastgif
```js
import {Decoder} from './node_modules/fastgif/fastgif.js';
const decoder = new Decoder();
window.fetch('path/to/gif.js')
.then((response) => response.arrayBuffer())
.then((buffer) => decoder.decode(buf))
.then((out) => {
// out is an array of {imageData: ImageData, delay: number}
});
```
Requires WebAssembly support, aka modern Edge, Chrome, Safari or Firefox.
Check first by looking for `window.WebAssembly`.
Based on [Wuffs](https://github.com/google/wuffs).
For a demo and speed comparison, [check here](https://samthor.github.io/fastgif/fastgif.html).
For a writeup of how this works, see [Fast GIF parsing on the web with WASM + Wuffs](https://dev.to/samthor/fast-gif-parsing-on-the-web-with-wasm--wuffs-48l4)!