Package Exports
- decode-bmp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (decode-bmp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Decode BMP
Decode .bmp images
Installation
npm install --save decode-bmpUsage
const decodeBmp = require('decode-bmp')
const fs = require('fs')
const source = fs.readFileSync('foobar.bmp')
const image = decodeBmp(source)
console.log(image)
//=> { width: 32, height: 32, data: Uint8ClampedArray(...), colorDepth: 32 }API
decodeBmp(source: ArrayBuffer | Buffer) => ImageData
Decodes the .bmp file in the given buffer, and returns an image.
The image has the following properties:
width: number- The width of the image, in pixelsheight: number- The height of the image, in pixelsdata: Uint8ClampedArray- The data of the image, in theRGBAformatcolorDepth: number- The color depth of the image as the number of bits used per pixel