PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, May 5, 2022

[FIXED] How to write a text + emojis on an background image with node js

 May 05, 2022     emoji, image, node.js, text     No comments   

Issue

This is a very unspecific question, but I couldn't find any reasonable help in the internet to complete this project on my on, so I thought here may be somebody who could help me.

I would like to print text (with emojis in it) on a background image with nodejs.

So I'm able to convert text to an image with text-to-image or text2png. I'm also able to convert an emoji to image data. But I haven't found a way to print text on an existing (background) image AND even add the emoji image at the right position in between the text.

If you have a solution in an other language for example python, that would be okay too. Then I would only need to get the text from nodes to python, which should not be too complicated.


Solution

Interesting that no one has answered this. I am trying to find a solution for the exact same need (minus the emoji :))

If you can do text to image, then I just found an article that shows how to composite two images using jimp. This seems like it would meet your needs. Providing text-to-image will save with transparent background.

I am going to try both these steps and I'll get back to you.

FOLLOW UP: There is "add-text-to-image". It's lightweight. Although it's poorly documented, I had to look at the source to get the parameters available.

JIMP lets you add text 'out of the box' and composite images, so you could do your text and add your emoji.

Hope that helps.



Answered By - j-p
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing