Skip to content

Commit d53c5b9

Browse files
committed
Create 0000.py
1 parent 36e0e50 commit d53c5b9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Liez-python-code/0000/0000.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
from PIL import Image, ImageDraw, ImageFont
3+
4+
def add_num():
5+
im = Image.open('in.jpg')
6+
xsize, ysize = im.size
7+
draw = ImageDraw.Draw(im)
8+
font = ImageFont.truetype("arial.ttf", xsize // 3)
9+
draw.text((ysize // 5 * 4, 0), '3', (250,128,114), font)
10+
im.save('out.jpg')
11+
12+
add_num()

0 commit comments

Comments
 (0)