Socket
Socket
Sign inDemoInstall

decode-bmp

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    decode-bmp

Decode `.bmp` images


Version published
Maintainers
1
Install size
25.6 kB
Created

Readme

Source

Decode BMP

Decode .bmp images

Installation

npm install --save decode-bmp

Usage

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 pixels
  • height: number - The height of the image, in pixels
  • data: Uint8ClampedArray - The data of the image, in the RGBA format
  • colorDepth: number - The color depth of the image as the number of bits used per pixel

FAQs

Last updated on 16 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc