A utility function for sending pixel data to an rgb led matrix with an optional console preview.
constructor with optional display width
and height
defaults to 64 x 64
- 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
var ezPixel = require('../index')(32)
ezPixel.map('demo/hat.png', (x, y, rgba) => {
// do stuff with the pixel data
}, true)
MIT, see LICENSE.md for details.