@cwasm/nsbmp
v0.1.3
Published
BMP decoding for Node.js, using [Libnsbmp][Libnsbmp] compiled to [WebAssembly][WebAssembly].
Downloads
16,847
Readme
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