Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


PIL Draw Image, Text, Font

06 Jan 2021 »
from PIL import Image, ImageDraw, ImageFont



img = Image.new('RGB', (1400,400), color = (255, 255, 255))


fnt = ImageFont.truetype("/usr/share/fonts/dejavu/DejaVuSans.ttf", 80)
d = ImageDraw.Draw(img)
d.text((450,150), "<not found>", font=fnt, fill=(0,0,0))

img.save("notfound.png")