1.0.0 • Published 8 years ago
ez-pixel v1.0.0
ez-pixel
Takes in an image resizes it and spits it out pixel by pixel
A utility function for sending pixel data to an rgb led matrix with an optional console preview.
Usage
ezPixel([width, height])
constructor with optional display width
and height
defaults to 64 x 64
ezPixel.map(imagePath, cb, log)
- imports the image at
imagePath
- resizes it to width and height given in the constructor
- runs the callback function passing it the pixel position and color
cb(x, y, rgba)
- if
log
is true it will print the image to the console
Example
var ezPixel = require('../index')(32)
ezPixel.map('demo/hat.png', (x, y, rgba) => {
// do stuff with the pixel data
}, true)
License
MIT, see LICENSE.md for details.
1.0.0
8 years ago