📌  相关文章
📜  将文本放在图像上 python 代码示例

📅  最后修改于: 2022-03-11 14:46:02.097000             🧑  作者: Mango

代码示例1
from PIL import Image, ImageFont, ImageDraw

my_image = Image.open("image.jpg")

title_font = ImageFont.truetype('font.ttf', 200)

image_editable = ImageDraw.Draw(my_image)
image_editable.text((15,15), "Text goes here", (237, 230, 211), font=title_font)

my_image.save("image-text.jpg")