I would like to use the node API pointer . I need to convert the image to grayscale and then to arrays containing arrays / strings of pixel values. Where to begin?
These tools take a specific format for images, a list of lists, each sub-list containing a "string" of values corresponding to n pixels in the image.
e.g. [[float, float, float ... *n ], [float, float, float ... *n ], ... *n]
Since pixels are typically represented by RGBA values, you can use the following formula to convert to grayscale.
Y = (0.2126 * R + 0.7152 * G + 0.0722 * B) * A
We are working on automatic scaling of images, but at the moment this is provided to you a square image
source
share