image processing - Write text on existing PNG with Node.js -
I am trying to create a static dynamic badge (PNG) so that the application can be embedded in a static page.
I have to use an existing PNG image and write some text along with some nodes on it. I've got a lot of libraries, but all of them have to use ImageMagic or Cairo to have basic dependencies, I would like to avoid installing something else on the server.
I have received a letter then, but I can not really understand how to write text on an image with it. How can i do
You can use it's print method:
Var requires GIMP = "GIMP"); Var filename = 'test.png'; Var imageCaption = 'image caption'; Var loaded image; Jimp.read (fileName). Then (function (image) {loadedImage = image; back to Jimp.loadFont (Jimp.FONT_SANS_16_BLACK);}). Then (function (font) {loadedImage.print (font, 10, 10, image caption) .write (fileName);}) .cache (function (mistake) {console.error (err);});
Comments
Post a Comment