diff --git a/lulujianjie/0000/0000.py b/lulujianjie/0000/0000.py index 2b7d98c2..a8be6a7c 100644 --- a/lulujianjie/0000/0000.py +++ b/lulujianjie/0000/0000.py @@ -1 +1,17 @@ -print "hello python" +from PIL import Image,ImageDraw,ImageFont + +def addNum(filePath): + img = Image.open(filePath) + size = img.size + fontSize = size[1] / 4 + draw = ImageDraw.Draw(img) + + ttFont = ImageFont.truetype("symbol.ttf", fontSize) + draw.text((size[0]-fontSize, 0), "6",(256,0,0), font=ttFont) + del draw + img.save('./result.jpg') + img.show() + + +if __name__ == '__main__': + addNum("image.jpg") diff --git a/lulujianjie/0000/image.jpg b/lulujianjie/0000/image.jpg new file mode 100644 index 00000000..a913ac40 Binary files /dev/null and b/lulujianjie/0000/image.jpg differ