In this tutorial, you’ll find out how to add text on the HTML5 <canvas> element. For that, you need Javascript. Use the fillText() and strokeText() methods.
Read this JavaScript tutorial and learn about the best method of calculating the text width. Read about the advantages of the method over other methods.
Read this tutorial and learn several methods of converting an image to a Base64 string using JavaScript. Choose the right approach for you and try examples.