Socket
Socket
Sign inDemoInstall

decode-bmp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decode-bmp

Decode `.bmp` images


Version published
Maintainers
1
Created
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

Package last updated on 16 Nov 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc