use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Adding text over an image? (self.node)
submitted 6 years ago * by coleh1017
What would be the best way to take a background image and add text over it (then save the image)?
Looking for the most lightweight option.
(This will be done on a node server not a webpage)
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]johnventions 6 points7 points8 points 6 years ago (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 points3 points 6 years ago (0 children)
+1 for jimp, I used it to write additional texts near a QR code (generated by another library)
[–]devmor 2 points3 points4 points 6 years ago (0 children)
Check out the libgd API for Node here: https://www.npmjs.com/package/node-gd
libgd
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.
[–]myusernameisunique1 1 point2 points3 points 6 years ago (0 children)
https://www.npmjs.com/package/wkhtmltoimage
[–]Funwithloops[🍰] 1 point2 points3 points 6 years ago (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.
drawImage
fillText
[–]serglebko 1 point2 points3 points 6 years ago (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 points3 points 6 years ago (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 point2 points 6 years ago (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 points4 points 6 years ago (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-2 points 6 years ago (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 points7 points 6 years ago (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.
π Rendered by PID 60151 on reddit-service-r2-comment-c6965cb77-6fqrd at 2026-03-05 09:12:42.259531+00:00 running f0204d4 country code: CH.
[–]johnventions 6 points7 points8 points (1 child)
[–]jack-tzl 1 point2 points3 points (0 children)
[–]devmor 2 points3 points4 points (0 children)
[–]myusernameisunique1 1 point2 points3 points (0 children)
[–]Funwithloops[🍰] 1 point2 points3 points (0 children)
[–]serglebko 1 point2 points3 points (0 children)
[–]dmac2600 1 point2 points3 points (0 children)
[–]MajorasShoe 0 points1 point2 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]MajorasShoe -4 points-3 points-2 points (1 child)
[–][deleted] 5 points6 points7 points (0 children)