#原始图像 #图像添加文本
#
from PIL import Image, ImageDraw, ImageFont
img = Image.open("E:\R_scripts\cox\sex.png")
d1 = ImageDraw.Draw(img)
# myFont = ImageFont.truetype('E:/PythonPillow/Fonts/FreeMono.ttf', 40)
# d1.text((0, 0), "Sample text", font=myFont, fill =(255, 0, 0))
d1.text((1000, 1000), "this is our work result png", fill =(255, 0, 0))
img.show()
img.save("E:\R_scripts\cox\sex_text.png")
#
from PIL import Image, ImageDraw img = Image.open(test.jpg') d1 = ImageDraw.Draw(img) d1.text((28



