You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sigonasr2
0785506fad
|
4 years ago | |
---|---|---|
.. | ||
lib | 4 years ago | |
test | 4 years ago | |
.npmignore | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
bmp-js.iml | 4 years ago | |
index.js | 4 years ago | |
package.json | 4 years ago |
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:
-
fileSize,reserved,offset
-
headerSize,width,height,planes,bitPP,compress,rawSize,hr,vr,colors,importantColors
-
palette
-
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