PIL - drawing text and saving
I have created this program:
from PIL import Image, ImageDraw
a = Image.open(r'C:\Users\damian\Desktop\a.png')
draw = ImageDraw.Draw(a)
draw.text((1, 1), 'Hello World!')
a.save(r'C:\Users\damian\Desktop\a.png', "PNG")
In theory it should load image, draw text on it and save it b开发者_开发问答ut when I run it nothing happens. Can someone have a look and advise?
Edit.
I've solved this, it seems default colour is white and drawn text wasn't visible on my white image, fill="black" was needed.
This question can now be closed.
I've solved this, it seems default colour is white and drawn text wasn't visible on my white image, fill="black" was needed.
This question can now be closed.
精彩评论