get-canvas-pixels
v1.0.0
Published
Get an array of RGBA pixel values from a canvas
Downloads
4
Readme
get-canvas-pixels
Get an array of RGBA pixel values from a canvas
Extracts an Uint8ClampedArray of RGBA pixel values from a canvas.
Install
$ npm install get-canvas-pixels
Usage
var getCanvasPixels = require('get-canvas-pixels');
var canvas = document.getElementById('canvas');
var pixels = getCanvasPixels(canvas);
console.log(pixels);
/*
[0, 0, 0, 255, 255, 255, 255, 255, ...]
*/