# canvas-pixels

> Grab the pixels from a canvas' context, be it 2D or 3D, and return them in an array.

Latest version **0.0.0** (published 2014-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install canvas-pixels
pnpm add canvas-pixels
yarn add canvas-pixels
bun add canvas-pixels
```

## 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.0.0 |
| Published | 2014-06-05 |
| First published | 2014-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | canvas, webgl, context, pixel, array, data, color |

## Links

- npm: https://www.npmjs.com/package/canvas-pixels
- Repository: https://github.com/hughsk/canvas-pixels
- Issues: https://github.com/hughsk/canvas-pixels/issues
- npm.io page: https://npm.io/package/canvas-pixels

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.0.0 (latest) — 2014-06-05

## README

# canvas-pixels [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Grab the pixels from a canvas' context, be it 2D or 3D, and return them in
an array.

## Usage

[![NPM](https://nodei.co/npm/canvas-pixels.png)](https://nodei.co/npm/canvas-pixels/)

### pixels = getPixels(context)

Returns `context`'s pixels in an array – with a 2D context, this will be a
`Uint8ClampedArray`, and a webgl context will return a `Uint8Array`.

### pixels.get2d(context)
### pixels.get3d(context)

Same as above, but without the auto-detection.

## License

MIT. See [LICENSE.md](http://github.com/hughsk/canvas-pixels/blob/master/LICENSE.md) for details.

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