GT2/Ejectable/node_modules/bmp-js
Ren Juan 06c1a5835d set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
..
lib set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
test set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
.npmignore set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
LICENSE set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
README.md set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
bmp-js.iml set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
index.js set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
package.json set clean start from expo 4.10 2021-08-16 00:14:59 +00:00

README.md

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