Skip to content

Commit c688b2b

Browse files
committed
Append pil_pillow__examples\simple_draw__hello_world
1 parent 276d890 commit c688b2b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
__author__ = 'ipetrash'
5+
6+
7+
# pip install Pillow
8+
from PIL import Image, ImageDraw, ImageFont
9+
10+
image = Image.open("images.jpg")
11+
12+
font = ImageFont.truetype("arial.ttf", 25)
13+
drawer = ImageDraw.Draw(image)
14+
drawer.text((50, 100), "Hello World!\nПривет мир!", font=font, fill='black')
15+
16+
image.save('new_img.jpg')
17+
image.show()

0 commit comments

Comments
 (0)