Skip to content

fastgif, fast Web Assembly GIF decoder based on Wuffs

License

Notifications You must be signed in to change notification settings

samthor/fastgif

Repository files navigation

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!

About

fastgif, fast Web Assembly GIF decoder based on Wuffs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages