GIF decoding for Node.js, using Libnsgif compiled to WebAssembly.
npm install --save @cwasm/nsgif
const fs = require('fs')
const nsgif = require('@cwasm/nsgif')
const source = fs.readFileSync('image.gif')
const image = nsgif.decode(source)
console.log(image)
// { width: 128,
// height: 128,
// data:
// Uint8ClampedArray [ ... ] }
decode(source)
source
(Uint8Array
, required) - The GIF dataImageData
- Decoded width, height and pixel data