# bmpimagejs

> pure bmp decoder library for nodejs, support all bmp formats,converted from http://www.netsurf-browser.org/projects/libnsbmp/

Latest version **1.0.4** (published 2018-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install bmpimagejs
pnpm add bmpimagejs
yarn add bmpimagejs
bun add bmpimagejs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2018-01-13 |
| First published | 2018-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hamza kılıç |
| Maintainers | hamzakilic |
| Keywords | bmp, decoder, library |

## Links

- npm: https://www.npmjs.com/package/bmpimagejs
- Repository: https://github.com/hamzakilic/bmpjs
- Homepage: https://github.com/hamzakilic/bmpjs#readme
- Issues: https://github.com/hamzakilic/bmpjs/issues
- npm.io page: https://npm.io/package/bmpimagejs

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2018-01-13
- 1.0.3 — 2018-01-12
- 1.0.2 — 2018-01-12
- 1.0.1 — 2018-01-06
- 1.0.0 — 2018-01-06

## README

# bmpimagejs
pure javascript nodejs library for decoding all bmp files
converted from c library http://www.netsurf-browser.org/projects/libnsbmp/


#npm link<br/>
https://www.npmjs.com/package/bmpimagejs


#install <br/>
npm install bmpimagejs --save

#build<br/>
gulp buildsrc

#test<br/>
gulp runspec

#usage

var bmp=require('bmpimagejs');<br/>
var fs=require('fs');<br/>
fs.readFile('filename', (err, data) => {            
            try{
            
            let img= bmp.decode(data.buffer); 
            //if decoding fails, throws a DecodeError;          
            //otherwise returns an RGBA image object
            console.log(img.width);
            console.log(img.height);
            console.log(img.pixels);
            for(var y=0;y<img.height;++y)
            for(var x=0;x<img.width;++x){
                var pixelPos=y*img.width*4+x*4;
                img.pixels[pixelPos]=10;//set R
                img.pixels[pixelPos+1]=10;//set G
                img.pixels[pixelPos+2]=10;//set B
                img.pixels[pixelPos+3]=10;//set A
            }
            
            }catch(ex){
                console.log(ex.errNumber);
                console.log(ex.message);
            }

        });

---
_Source: https://npm.io/package/bmpimagejs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
