1.0.0 • Published 7 years ago

image-to-rgba-matrix v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

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