@cwasm/nsgif
v0.1.2
Published
GIF decoding for Node.js, using [Libnsgif][Libnsgif] compiled to [WebAssembly][WebAssembly].
Downloads
19,792
Readme
GIF
GIF decoding for Node.js, using Libnsgif compiled to WebAssembly.
Installation
npm install --save @cwasm/nsgif
Usage
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 [ ... ] }
API
decode(source)
source
(Uint8Array
, required) - The GIF data- returns
ImageData
- Decoded width, height and pixel data