# get-avg-pixel

> get the average of an array of pixel data

Latest version **1.0.0** (published 2015-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-avg-pixel
pnpm add get-avg-pixel
yarn add get-avg-pixel
bun add get-avg-pixel
```

## 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.0.0 |
| Published | 2015-08-02 |
| First published | 2015-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cole Willsea |
| Maintainers | coleww |
| Keywords | pixel, canvas, image, art |

## Links

- npm: https://www.npmjs.com/package/get-avg-pixel
- Repository: https://github.com/coleww/get-avg-pixel
- Issues: https://github.com/coleww/get-avg-pixel/issues
- npm.io page: https://npm.io/package/get-avg-pixel

## Dependencies (2)

- [tape](https://npm.io/package/tape.md) ^4.0.1
- [standard](https://npm.io/package/standard.md) ^4.5.4

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-08-02

## README

get-avg-pixel
----------------

given an array of pixel data not unlike that returned by `canvasContext.getImageData().data`, returns the data for the average of all of the pixels as `{r: 0-255, g: 0-255, b: 0-255, a: 0-255}`

[![NPM](https://nodei.co/npm/get-avg-pixel.png)](https://nodei.co/npm/get-avg-pixel/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) [![Build Status](https://secure.travis-ci.org/coleww/get-avg-pixel.png)](http://travis-ci.org/coleww/get-avg-pixel)


### EXAMPLE

```
  /// ... canvas/context setup code up here ... \\\\\\
  var pixels = ctx.getImageData().data
  var getAvgPixel = require('get-avg-pixel')
  getAvgPixel(pixels)
  // => {r: 100, g: 212, b: 53, a: 183}
  // now do something with that pixel data
```

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