Re:Grafi.js – JavaScript Image Processing Library
by onion2k on Tuesday April 26, 2016 @03:55AM
(#11570136)
That is true, but grafi.js relies on a browser's canvas API to convert an image to a Uint8ClampedArray of colour values, so it won't work on a command line or backend either. As a way to learn about convolution filters it seems fairly good though.
[ Parent
| on HN ]
Re:Grafi.js – JavaScript Image Processing Library
by dkopi on Tuesday April 26, 2016 @04:08AM
(#11570180)
Good point. https://www.npmjs.com/package/get-pixels can help parse an image to pixels, but it returns a different format than the canvas API's Uint8ClampedArray.
Re:Grafi.js – JavaScript Image Processing Library
by megalodon on Tuesday April 26, 2016 @08:53AM
(#11571380)
I haven't tested but I think you can convert ndarray to Uint8ClampedArray by doing
new Uint8ClampedArray(ndarray.data);