Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 647 Bytes

README.rst

File metadata and controls

34 lines (20 loc) · 647 Bytes

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.