image-to-rgba-matrix
v1.0.0
Published
Turn an image to a matrix of red, green, blue and alpha values
Downloads
30
Readme
image-to-rgba-matrix
Convert an image into a RGBA matrix.
Install
$ yarn add image-to-rgba-matrix
$ npm install --save image-to-rgba-matrix
Usage
// ES5
const imageToRgbaMatrix = require('image-to-rgba-matrix');
// ES6
import imageToRgbaMatrix from 'image-to-rgba-matrix';
// From file path
imageToRgbaMatrix('./path-to-image').then(console.log);
// From image (png/jpg/bmp) buffer
imageToRgbaMatrix(imageBuf).then(console.log);
// From url
imageToRgbaMatrix('http://bencevans.io/avatar.jpg').then(console.log);
Licence
MIT © Ben Evans