# @canvas/image-data

> An `ImageData` implementation for usage outside of the browser.

Latest version **1.1.0** (published 2025-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @canvas/image-data
pnpm add @canvas/image-data
yarn add @canvas/image-data
bun add @canvas/image-data
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2025-10-14 |
| First published | 2018-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | linusu |

## Links

- npm: https://www.npmjs.com/package/@canvas/image-data
- Repository: https://github.com/node-gfx/image-data
- Homepage: https://github.com/node-gfx/image-data#readme
- Issues: https://github.com/node-gfx/image-data/issues
- npm.io page: https://npm.io/package/@canvas/image-data

## Recent versions

- 1.1.0 (latest) — 2025-10-14
- 1.0.0 — 2018-11-20

## README

# ImageData

An `ImageData` implementation for usage outside of the browser.

## Installation

```sh
npm install --save @canvas/image-data
```

## Usage

```js
const ImageData = require('@canvas/image-data')

const img = new ImageData(2, 4)

console.log(img.width)
//=> 2

console.log(img.height)
//=> 4

console.log(img.data)
//=> Uint8ClampedArray [ 0, 0, 0, 0, 0, ... ]
```

## Hacking

The tests are made to be run against both this implementation and Chrome's implementation to make sure that we behave in the same way. You can run the tests in Chrome by spinning up a local web server and open `test.html`.

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