News for hackers. Stuff that matters.
Re:Grafi.js – JavaScript Image Processing Library by feiss on Tuesday April 26, 2016 @03:24AM (#11570023)
That's cool, but that doesn't interfere with the library main goal:

"grafi.js is a library intended for learning about how image processing works"

Re:Grafi.js – JavaScript Image Processing Library by benjaminbenben on Tuesday April 26, 2016 @05:41AM (#11570515)
I saw Mariko give a talk about this last week - http://2016.render-conf.com/talks#drawing-on-canvas-a-few-th...

It was absolutely fantastic; really great information about image data & how to process it.

Re:Grafi.js – JavaScript Image Processing Library by dkopi on Tuesday April 26, 2016 @03:44AM (#11570098)
Also - CSS tricks don't work if you're writing command line tools or backend code in JS.
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.
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);
Re:Grafi.js – JavaScript Image Processing Library by zbjornson on Tuesday April 26, 2016 @11:07AM (#11572480)
Node-canvas provides a compliant Canvas implementation:

https://github.com/Automattic/node-canvas

Re:Grafi.js – JavaScript Image Processing Library by alfanick on Tuesday April 26, 2016 @01:15PM (#11573733)
that is wrong way to do this - write efficient code (simple operations on an array) instead of using huge canvas library to make a library you don't need to use usable
Re:Grafi.js – JavaScript Image Processing Library by kowdermeister on Tuesday April 26, 2016 @01:22PM (#11573784)
And she beats the purpose instantly by adding this to the readme:

    they code is pretty rough & documentation is not great
There are much better tutorials out there for image processing: http://www.html5rocks.com/en/tutorials/canvas/imagefilters/