I you want to add a text to an image, you have to code like this:
from PIL import Image
def write():
img = Image.new('RGB', (200, 100),'pink')
d = ImageDraw.Draw(img)
e = ImageDraw.Draw(img)
e.text((0,0),"XXX",fill=(0,0,255))
d.text((20, 20), 'Siamo sicuri di questo?', fill=(255, 0, 0))
d.text((10, 10), 'Ciao come stai?', fill=(0, 0, 0))
return img
write()
Out[42]:
Comments
Post a Comment