JSPM

canvas-pixels

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 45
  • Score
    100M100P100Q58147F
  • License MIT

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

Package Exports

  • canvas-pixels

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (canvas-pixels) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

canvas-pixels stable

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

Usage

NPM

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 for details.