Socket
Socket
Sign inDemoInstall

bmp-js

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bmp-js

A pure javascript BMP encoder and decoder


Version published
Weekly downloads
1M
decreased by-16%
Maintainers
1
Install size
631 kB
Created
Weekly downloads
 

Readme

Source

bmp-js

A pure javascript Bmp encoder and decoder for node.js

Supports all bits decoding(1,4,8,16,24,32) and encoding with 24bit.

##Install

$ npm install bmp-js

How to use?

###Decode BMP

var bmp = require("bmp-js");
var bmpBuffer = fs.readFileSync('bit24.bmp');
var bmpData = bmp.decode(bmpBuffer);

bmpData has all properties includes:

  1. fileSize,reserved,offset

  2. headerSize,width,height,planes,bitPP,compress,rawSize,hr,vr,colors,importantColors

  3. palette

  4. data-------byte array order by ABGR ABGR ABGR,4 bytes per pixel

###Encode RGB

var bmp = require("bmp-js");
//bmpData={data:Buffer,width:Number,height:Height}
var rawData = bmp.encode(bmpData);//default no compression,write rawData to .bmp file

License

U can use on free with MIT License

Keywords

FAQs

Last updated on 23 Apr 2018

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