Simple way to create png image with an input text.

First, you need to have the PIL python module and import this.

Next will be this function. Basically will make and return one RGBA image data type.

The next step is to set the text, font, and the new image.

I use Arggotsc.ttf. You can use any TrueType font.

Now we can draw, add text, resize, but the text and finally save the image.

The output image is this:

PIL python module

See you later with another tutorial.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.