Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello,I want to join in this program. #93

Merged
merged 4 commits into from
Apr 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added acwong00/0000/Thumbs.db
Binary file not shown.
Binary file modified acwong00/0000/finnal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added agmcs/0000/Thumbs.db
Binary file not shown.
17 changes: 17 additions & 0 deletions lulujianjie/0000/0000.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from PIL import Image, ImageDraw, ImageFont

im = Image.open('image.jpg')
w,h = im.size
font_size = h/4

draw = ImageDraw.Draw(im)
fnt = ImageFont.truetype ("Arial.ttf",font_size)

text_w,text_h = draw.textsize("8",font=fnt) # 给定文字message,返回所占像素(width,height)

draw.text((w-text_w,0), "8", fill=(255,0,0), font=fnt)#图片宽度减去字体宽度、要写的字符、颜色、字体


im.save('image_1.jpg')

#reference http://www.cnblogs.com/wei-li/archive/2012/04/19/2456725.html
Binary file added lulujianjie/0000/Thumbs.db
Binary file not shown.
Binary file added lulujianjie/0000/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lulujianjie/0000/image_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.