We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c58e97 commit 31af5d5Copy full SHA for 31af5d5
1 file changed
deng47/problem 0000/solution for problem 0000.py
@@ -0,0 +1,13 @@
1
+from PIL import Image, ImageDraw, ImageFont
2
+
3
+def add_num(img):
4
+ draw = ImageDraw.Draw(img)
5
+ myfont = ImageFont.truetype('C:/windows/fonts/Calibri.ttf', size=90)
6
+ fillcolor = "#ff0000"
7
+ width, height = img.size
8
+ draw.text((width-90, 10), '4', font=myfont, fill=fillcolor)
9
+ img.save('result.jpg','jpeg')
10
11
+if __name__ == '__main__':
12
+ image = Image.open('test.jpg')
13
+ add_num(image)
0 commit comments