Is there a way to render a new image without using canvas?

I have an image and I have an input box for people to input some text. I want to put the text on the image and then render another new image.

Basically, if I have a canvas component on the page, I can simply to do it by using canvas and its context function. However, I don’t want to use canvas. I don’t place any canvas component on the page of my app. Instead, I want to implement it inside a service without the need of any HTML component.

How can I do that?

Thank you.