Skip to content

Commit 0314c94

Browse files
committedApr 5, 2015
nan86150 first commit
1 parent f791f61 commit 0314c94

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed
 

‎nan86150/0000/image.jpg

15.1 KB
Loading

‎nan86150/0000/main.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
# encoding: utf-8
3+
4+
import Image
5+
import ImageFont
6+
import ImageDraw
7+
8+
9+
text = u"7"
10+
11+
im = Image.open('./image.jpg')
12+
13+
dr = ImageDraw.Draw(im)
14+
font = ImageFont.truetype('msyh.ttf', 34)
15+
16+
dr.text((im.size[0]*0.85, im.size[1]*0.05), text, font=font, fill="#ff0000")
17+
18+
im.show()
19+
im.save('result.jpg')
20+

‎nan86150/0000/msyh.ttf

14.3 MB
Binary file not shown.

‎nan86150/0000/result.jpg

10.9 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.