# readimage

> Read an image (jpg, png, gif) into memory in the same format.

Latest version **1.1.1** (published 2014-09-01) · MIT license · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2014-09-01 |
| First published | 2014-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Bryce B. Baril |
| Maintainers | bryce |
| Keywords | image, jpg, jpeg, png, gif, read |

## Links

- npm: https://www.npmjs.com/package/readimage
- Repository: git@github.com:revisitors/readimage
- Homepage: https://github.com/revisitors/readimage
- Issues: https://github.com/revisitors/readimage/issues
- npm.io page: https://npm.io/package/readimage

## Dependencies (5)

- [omggif](https://npm.io/package/omggif.md) ^1.0.5
- [jpeg-js](https://npm.io/package/jpeg-js.md) 0.0.4
- [isnumber](https://npm.io/package/isnumber.md) ^1.0.0
- [pngparse](https://npm.io/package/pngparse.md) ^2.0.1
- [buffer-equal](https://npm.io/package/buffer-equal.md) 0.0.1

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2014-09-01
- 1.1.0 — 2014-08-30
- 1.0.0 — 2014-08-22

## README

readimage
=====

[![NPM](https://nodei.co/npm/readimage.png)](https://nodei.co/npm/readimage/)

Read an image into memory converting from whatever format it is in to a consistent set of RGBA frames independent on input format.

Why? Because image formats are a pain to worry about.

How fast is it? Not really sure. I don't need it to be fast.

How robust is it? Not really sure, if you have issues please file them!


```javascript

var fs = require("fs")
var readimage = require("readimage")

var filedata = fs.readFileSync("cat.png")

readimage(filedata, function (err, image) {
  if (err) {
    console.log("failed to parse the image")
    console.log(err)
  }
  console.log(image)
})

```

API
===

`require("readimage")(imageBuffer, callback)`
---

Read a buffer containing an image in PNG, GIF, or JPG format into a consistent RGBA format.

FORMAT
===

height, width, and an array of sequential frames. Non-animated images will have a single frame.

```js
{
  height: 100, // pixels
  width: 100, // pixels
  frames: [
    {
      data: ... // RGBA buffer
      delay: 100 // milliseconds before switching to next frame. OPTIONAL
    },
    {
      data: ...
      delay: 10
    }
  ]
}
```

LICENSE
=======

MIT

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