Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/canvas-pixels
Grab the pixels from a canvas' context, be it 2D or 3D, and return them in an array.
https://github.com/hughsk/canvas-pixels
Last synced: 12 days ago
JSON representation
Grab the pixels from a canvas' context, be it 2D or 3D, and return them in an array.
- Host: GitHub
- URL: https://github.com/hughsk/canvas-pixels
- Owner: hughsk
- License: other
- Created: 2014-06-05T07:30:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-05T07:30:54.000Z (over 10 years ago)
- Last Synced: 2024-10-17T16:41:12.924Z (22 days ago)
- Language: JavaScript
- Size: 104 KB
- Stars: 11
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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.