Skip to content

Latest commit

 

History

History

memegen

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Meme Generator

Let’s add some text to an image:

Bridge over Troubled Water

Bridge over Troubled Water

NumPy cannot add text of its own. You need to use the Pillow library instead:

.. literalinclude:: memegen.py

For the code to run, you need a True-Type-Font (TTF). You can use your own or download arial.ttf.

To convert a Pillow Image to a Numpy array, use:

a = np.array(im)

and back:

im = Image.fromarray(a)

Challenge

Add text to your own image to create a meme or inspirational image.