Answer the question
In order to leave comments, you need to log in
How to make "text area" on an image in PIL library?
There was such a problem that the text goes beyond the picture. What method can fix this? Here is my script:
img = Image.open("123.jpg")
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("1234.ttf", size=32)
draw.text((80, 80), "о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-о-очень длинный текст", font=font)
img.save('12345.jpg')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question