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

0.1.3 • Public • Published

BMP

BMP decoding for Node.js, using Libnsbmp compiled to WebAssembly.

Installation

npm install --save @cwasm/nsbmp

Usage

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

const source = fs.readFileSync('image.bmp')
const image = nsbmp.decode(source)

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

API

decode(source)

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

Readme

Keywords

none

Package Sidebar

Install

npm i @cwasm/nsbmp

Weekly Downloads

4,701

Version

0.1.3

License

MIT

Unpacked Size

32.2 kB

Total Files

5

Last publish

Collaborators

  • linusu