from PIL import Image, ImageDraw, ImageFont
img = Image.open("img/pic1.jpg")
print(img.size)
font = ImageFont.truetype('C:/Windows/Fonts/arial.ttf', 36)
draw = ImageDraw.Draw(img)
draw.text((20, 20), 'Hello', font=font, fill=(255,255,255))
print(img.size)
img.show()
參考資料來源:
https://yungyuc.github.io/oldtech/python/python_imaging.html