bmp-js
A pure javascript BMP encoder and decoder
Last updated 10 years ago by shaozilee .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install bmp-js 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

4 Versions

  • 0.1.0                                ...           7 years ago
  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           10 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE