Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions deng47/problem 0000/solution for problem 0000.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from PIL import Image, ImageDraw, ImageFont

def add_num(img):
draw = ImageDraw.Draw(img)
myfont = ImageFont.truetype('C:/windows/fonts/Calibri.ttf', size=90)
fillcolor = "#ff0000"
width, height = img.size
draw.text((width-90, 10), '4', font=myfont, fill=fillcolor)
img.save('result.jpg','jpeg')

if __name__ == '__main__':
image = Image.open('test.jpg')
add_num(image)