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 = ;var bmpBuffer = fs;var bmpData = bmp;
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 = ;//bmpData={data:Buffer,width:Number,height:Height}var rawData = bmp;//default no compression,write rawData to .bmp file
License
U can use on free with MIT License