0.1.2 • Published 5 years ago

@cwasm/nsgif v0.1.2

Weekly downloads
371
License
MIT
Repository
github
Last release
5 years ago

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