Skip to content

Commit 31af5d5

Browse files
committed
Added files via upload
1 parent 3c58e97 commit 31af5d5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)