Skip to content

Commit b440d19

Browse files
committed
This is copy just for test
1 parent c39bfa5 commit b440d19

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lulujianjie/0000/0000.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
print "hello python"
1+
from PIL import Image,ImageDraw,ImageFont
2+
3+
def addNum(filePath):
4+
img = Image.open(filePath)
5+
size = img.size
6+
fontSize = size[1] / 4
7+
draw = ImageDraw.Draw(img)
8+
9+
ttFont = ImageFont.truetype("symbol.ttf", fontSize)
10+
draw.text((size[0]-fontSize, 0), "6",(256,0,0), font=ttFont)
11+
del draw
12+
img.save('./result.jpg')
13+
img.show()
14+
15+
16+
if __name__ == '__main__':
17+
addNum("image.jpg")

lulujianjie/0000/image.jpg

45.7 KB
Loading

0 commit comments

Comments
 (0)