Closed bradparks closed 8 years ago
The whole library is heavily dependent on the canvas element and it's context. You could try coupling it with https://github.com/Automattic/node-canvas
I did it a try using metalsmith and jimp: https://github.com/lucawyss/metalsmith-dither it's heavily inspired by DitherJs (kind of fork).
I just change the output of the dithering function to send it to Jimp.write()
function.
ps: I really love this plugin btw! thanks @dpiccone
Hey! I'm playing around with node and dithering and would love to see an example of this running in node. Do you have one somewhere? I'm just not sure where the image data/context would come from?
https://github.com/dpiccone/ditherjs/blob/master/src/ditherjs.js#L359-L362
I just saw a node export at the bottom of the src, and thought it may have been tried?
https://github.com/dpiccone/ditherjs/blob/master/src/ditherjs.js#L414
Thanks!