@cwasm/nsgif

GIF decoding for Node.js, using [Libnsgif][Libnsgif] compiled to [WebAssembly][WebAssembly].

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@cwasm/nsgif
3910.1.23 years ago3 years agoMinified + gzip package size for @cwasm/nsgif in KB

Readme

GIF
GIF decoding for Node.js, using LibnsgifLibnsgif compiled to WebAssemblyWebAssembly.

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