fastgif, fast Web Assembly GIF decoder based on Wuffs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
testdata version bump and more testdata Jul 4, 2018
.gitignore initial demo Jun 27, 2018
.npmignore ready to npm Jun 28, 2018
LICENSE Initial commit Jun 27, 2018
README.md Update README.md Jun 28, 2018
fastgif-playground.html
fastgif.html version bump and more testdata Jul 4, 2018
fastgif.js version bump and more testdata Jul 4, 2018
package.json version bump and more testdata Jul 4, 2018

README.md

fastgif

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.

For a demo and speed comparison, check here. For a writeup of how this works, see Fast GIF parsing on the web with WASM + Wuffs!