@cwasm/webp
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

WebP

WebP decoding for Node.js, using libwebp compiled to WebAssembly.

Installation

npm install --save @cwasm/webp

Usage

const fs = require('fs')
const webp = require('@cwasm/webp')

const source = fs.readFileSync('image.webp')
const image = webp.decode(source)

console.log(image)
// { width: 128,
//   height: 128,
//   data:
//    Uint8ClampedArray [ ... ] }

API

decode(source)

  • source (Uint8Array, required) - The WEBP data
  • returns ImageData - Decoded width, height and pixel data

Readme

Keywords

none

Package Sidebar

Install

npm i @cwasm/webp

Weekly Downloads

6,656

Version

0.1.5

License

MIT

Unpacked Size

98.8 kB

Total Files

5

Last publish

Collaborators

  • linusu