# im-decode

> A node.js library that leverages ImageMagick to turn images into RGBA arrays (Uint8Arrays).

Latest version **0.1.2** (published 2014-01-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-01-08 |
| First published | 2013-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mike Maelzer |
| Maintainers | mmaelzer |
| Keywords | imagemagick, jpg, jpeg, decode, decoder, rgba |

## Links

- npm: https://www.npmjs.com/package/im-decode
- Repository: https://github.com/mmaelzer/im-decode
- Issues: https://github.com/mmaelzer/im-decode/issues
- npm.io page: https://npm.io/package/im-decode

## 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

- 0.1.2 (latest) — 2014-01-08
- 0.1.1 — 2014-01-05
- 0.1.0 — 2013-12-28

## README

im-decode
=========
  
A node.js library that leverages [ImageMagick](http://www.imagemagick.org) to turn images into RGBA arrays (Uint8Arrays).
  
  
## Install

```
npm install im-decode
```  
  
`im-decode` requires ImageMagick CLI tools to be installed. There's plenty of ways to install ImageMagick, choose what's right for you.

## Usage

```javascript
var decode = require('im-decode');
decode(imageBuffer, function(err, rgbaArray) {
  // do something
});
```

### decode(image, [dimensions], callback)
* image `Buffer`
* dimensions (optional) `Array` of dimensions in the form [w, h], i.e. [640, 480]
* callback `Function(Error, Uint8Array)`  

Returns a `Uint8Array` when provided an image as a `Buffer`. Passing in a dimensions `Array` is optional, but will provide a slight speed improvement (~7% speed increase for 640x480 images was seen in testing). The speed improvement is due to the nature of knowing the size of the end result `Buffer` vs continually creating new `Buffers` of ever increasing size. At least that's my assumption without diving into it any deeper.

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