javascript - Nodejs create a PNG image with text inside -
i'm trying create new png file serve clients via http (as response type image/png)
the new file created concatenating 3 base png files , adding custom text
in middle of image.
problem is, there no built-in library in nodejs this. spent couple of hours searching , surprise, there no pure js
library this. closest thing node-pngjs lacks ability add text. understand text part complicated since it's dependent on os (fonts installed, dlls interface said fonts, etc).
there other node modules wrappers around imagemagick (gm) , gtk (canvas) unfortunately imagemagick 155mb of binaries, , use canvas need compile source, install python
, vs 2010 c++ express edition
, not work on lastest version of gtk.
the best got right write .net assembly , use inside node via edge.js, require both windows os , .net framework on server.
again, complicated part here adding text inside image.
any suggestion on how working without sh**load of external dependencies?
yes correct, node.js support image processing libraries weak, wrappers of cli application.
the solution use involves phantomjs has canvas , svg support, use these features. it's lighter other options , not require external applications installed. http://phantomjs.org/quick-start.html
Comments
Post a Comment