# decode-bmp

> Decode `.bmp` images

Latest version **0.2.1** (published 2019-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install decode-bmp
pnpm add decode-bmp
yarn add decode-bmp
bun add decode-bmp
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-11-16 |
| First published | 2018-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.6.0 |
| Dependencies | 2 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | linusu |

## Links

- npm: https://www.npmjs.com/package/decode-bmp
- Repository: https://github.com/LinusU/decode-bmp
- Homepage: https://github.com/LinusU/decode-bmp#readme
- Issues: https://github.com/LinusU/decode-bmp/issues
- npm.io page: https://npm.io/package/decode-bmp

## Dependencies (2)

- [to-data-view](https://npm.io/package/to-data-view.md) ^1.1.0
- [@canvas/image-data](https://npm.io/package/@canvas/image-data.md) ^1.0.0

## Recent versions

- 0.2.1 (latest) — 2019-11-16
- 0.2.0 — 2019-11-10
- 0.1.0 — 2018-11-06

## README

# Decode BMP

Decode `.bmp` images

## Installation

```sh
npm install --save decode-bmp
```

## Usage

```js
const decodeBmp = require('decode-bmp')
const fs = require('fs')

const source = fs.readFileSync('foobar.bmp')
const image = decodeBmp(source)

console.log(image)
//=> { width: 32, height: 32, data: Uint8ClampedArray(...), colorDepth: 32 }
```

## API

### `decodeBmp(source: ArrayBuffer | Buffer) => ImageData`

Decodes the `.bmp` file in the given buffer, and returns an image.

The image has the following properties:

- `width: number` - The width of the image, in pixels
- `height: number` - The height of the image, in pixels
- `data: Uint8ClampedArray` - The data of the image, in the `RGBA` format
- `colorDepth: number` - The color depth of the image as the number of bits used per pixel

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