Skip to content

Commit 6be60ec

Browse files
committed
Merge pull request Show-Me-the-Code#5 from Show-Me-the-Code/master
merge from master
2 parents 72ac311 + c4ef640 commit 6be60ec

312 files changed

Lines changed: 11958 additions & 25 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ target/
5555

5656
# Mac File
5757
.DS_Store
58+
.idea

‎4disland/0000/image.jpg‎

-6.41 KB
Binary file not shown.

‎4disland/0000/result.jpg‎

-6.96 KB
Binary file not shown.

‎DIYgod/0000/pic.jpg‎

-68 KB
Binary file not shown.

‎DIYgod/0000/pic_with_num.jpg‎

-17.8 KB
Binary file not shown.

‎DIYgod/0005/pictest.jpg‎

-784 KB
Binary file not shown.

‎DIYgod/0005/result.jpg‎

-39.7 KB
Binary file not shown.

‎Jimmy66/0000/image.jpg‎

-45.7 KB
Binary file not shown.

‎Jimmy66/0013/范例.py‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎LXFY/0000/main.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from PIL import Image, ImageDraw, ImageFont
2+
3+
def add_num(filePath, num=1):
4+
img = Image.open(filePath)
5+
size = img.size
6+
fontsize = size[1]/4
7+
myfont = ImageFont.truetype('Futura.ttf', fontsize)
8+
ImageDraw.Draw(img).text((2 * fontsize, 0), str(num), font = myfont, fill = 'red')
9+
img.save('avatar_added.jpg')
10+
img.show()

0 commit comments

Comments
 (0)