生成图片:

from PIL import Image,ImageDraw
#生成图片:
img = Image.new("RGB",(1000,1000),(255,255,255))
#有了画笔:
draw = ImageDraw.Draw(img,"RGB")
#添加颜色:
# draw.point([100,100],fill="red")
#定义起始和终止生成竖线:
draw.line((100,100,200,300),fill="red")
#画圆:
draw.arc((100,100,300,300),0,360,fill="red")
#写文本:
draw.text([100,100],"python","red",size=28)
img.show()

你可能感兴趣的:(生成图片:)