fastgif

0.1.1 • Public • Published

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!

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    0
  • 0.1.0
    1

Package Sidebar

Install

npm i fastgif

Weekly Downloads

1

Version

0.1.1

License

Apache-2.0

Unpacked Size

56.7 kB

Total Files

4

Last publish

Collaborators

  • samthor