Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

png-to-matrix

SEECOWS27MIT1.0.5

An image to 2D RGBA matrix conversion module

png, matrix, image, rgba, conversion

readme

PNG To Matrix

Convert Images to Matrices with one simple function

How it works:

const pngToMatrix = require('png-to-matrix')

pngToMatrix("path/to/image", (matrix) => {
    console.log(matrix)
    /*
    ** Returns:
    ** [ 'N Dimensions of X as a numerical key': [ N Dimensions of Y as an array - Each array value has a "r,g,b,a" value. ] ] }
    */
})

Published under MIT License