Skip to content

Commit 00e1556

Browse files
committed
update pillow
1 parent de9409e commit 00e1556

File tree

7 files changed

+77
-7
lines changed

7 files changed

+77
-7
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ redis = "*"
2929
pendulum = "*"
3030
mypy = "*"
3131
mypy-extensions = "*"
32+
pillow = "*"
3233

3334

3435
[dev-packages]

Pipfile.lock

Lines changed: 51 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/pil_sp/create_image.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from PIL import Image
2+
3+
4+
def main():
5+
im = Image.new("RGB", (200, 200), "#FFF")
6+
im.show()
7+
8+
9+
if __name__ == '__main__':
10+
main()

packages/pil_snippets/hello_pil.py renamed to packages/pil_sp/hello_pil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# coding: utf-8
2-
from __future__ import print_function
31
from PIL import Image
42

53

64
def main():
75
im = Image.open("../_common_img/in.jpg")
86
print(im.format, im.size, im.mode)
7+
print(type(im.mode))
8+
im.show()
99

1010

1111
if __name__ == '__main__':

packages/pil_snippets/read_write_color.py renamed to packages/pil_sp/read_write_color.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
from __future__ import print_function
31
from PIL import Image, ImageDraw
42

53

File renamed without changes.

packages/pil_sp/write_text.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from PIL import Image, ImageFont, ImageDraw
2+
3+
4+
def main():
5+
im = Image.new("RGB", (600, 600), "#000")
6+
draw = ImageDraw.Draw(im)
7+
font = ImageFont.truetype("SourceHanSansCN-Normal.otf", 33)
8+
draw.text((10, 25), "大西瓜", font=font, fill="#F78")
9+
im.show()
10+
11+
12+
if __name__ == '__main__':
13+
main()

0 commit comments

Comments
 (0)