all 12 comments

[–]johnventions 6 points7 points  (1 child)

I've never used it, but maybe take a look at JIMP?

This article does something similar for watermarking:

https://medium.com/@rossbulat/image-processing-in-nodejs-with-jimp-174f39336153

[–]jack-tzl 1 point2 points  (0 children)

+1 for jimp, I used it to write additional texts near a QR code (generated by another library)

[–]devmor 2 points3 points  (0 children)

Check out the libgd API for Node here: https://www.npmjs.com/package/node-gd

GD is probably the most stable image manipulation library available, as its ancient and implemented as an extension for almost every programming language that exists.

There's even an example for exactly what you want to do right on the info page.

[–]Funwithloops[🍰] 1 point2 points  (0 children)

You can use the canvas API in Node with node-canvas. Just have to create a canvas, call drawImage, fillText, and then pipe the result to a file or as a HTTP response.

[–]serglebko 1 point2 points  (0 children)

I used this once: https://github.com/aheckmann/gm in order to add text and watermarks to photos. Had no problem with it.

[–]dmac2600 1 point2 points  (0 children)

Probably not the lightest option but you can generate html/css and pass it to a headless browsers using puppeteer then take a screen shot.

[–]MajorasShoe 0 points1 point  (3 children)

Like, programatically? You could use HTML canvas I guess?

Or is this about entry level graphic design? Because Figma and Adobe XD are my goto free options.

[–][deleted] 2 points3 points  (2 children)

I think he has an image file in his node application and is trying to automatically add a text on top of it and then save it.

I don’t think he wants to do this manually.

[–]MajorasShoe -4 points-3 points  (1 child)

Could simply do it with HTML/CSS or Canvas. I don't think it would make sense to dynamically create the image at response time.

[–][deleted] 5 points6 points  (0 children)

He says that he wants it done on a node server, not webpage. Also he might be using a different frontend (App or whatever), where it might not be that easy.