Skip to content

Commit ec1b0dc

Browse files
committed
Merge pull request Show-Me-the-Code#88 from nan86150/master
nan86150 first commit
2 parents f791f61 + 0314c94 commit ec1b0dc

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

Lines changed: 20 additions & 0 deletions
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)