from PIL import Image, ImageDraw, ImageFont
img = Image.open(r'binod.jpg')
draw = ImageDraw.Draw(img)
text = "clcoding.com"
font = ImageFont.truetype('arial.ttf', 50)
textwidth, textheight = draw.textsize(text, font)
width, height = img.size
x=width/2-textwidth/2
y=height-textheight-50
draw.text((x, y), text, font=font)
img.save(r'binod.png')
Image.open('binod.png')
0 Comments:
Post a Comment