I'm using ndarray. I'm doing console log:
console.log(ndarray.data)
it's:
Uint8Array [ 0, 0, 0, 255 ]
how can I convert it to array of arrays (array of array in above example) like this:
[[ 0, 0, 0, 255 ]]
When I have Uint8Array like this one:
Uint8Array [
0, 0,
0, 255,
0, 0,
0, 255
]
then I would like it to be
[[ 0, 0, 0, 255 ], [ 0, 0, 0, 255 ]]
but with given answer it's
[ [
0, 0,
0, 255,
0, 0,
0, 255
] ]