-
Notifications
You must be signed in to change notification settings - Fork 1
/
ImageConverters.py
95 lines (89 loc) · 4.41 KB
/
ImageConverters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from PIL import ImageTk, Image
import os
def ICSayoriTurned(image, strings):
characterString = strings[-1]
r = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_{strings[0].get()}.png").resize((480, 480))
l = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_{strings[1].get()}.png").resize((480, 480))
head = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_{strings[2].get()}.png").resize(
(480, 480))
mouth = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_mouth_{strings[3].get()}.png").resize(
(480, 480))
nose = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_nose_{strings[4].get()}.png").resize(
(480, 480))
eyes = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_eyes_{strings[5].get()}.png").resize(
(480, 480))
eyebrows = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_turned_eyebrows_{strings[6].get()}.png").resize(
(480, 480))
imager = ImageTk.getimage(image)
imager.paste(im=l, box=(0, 0), mask=l)
imager.paste(im=r, box=(0, 0), mask=r)
imager.paste(im=head, box=(0, 0), mask=head)
imager.paste(im=mouth, box=(0, 0), mask=mouth)
imager.paste(im=nose, box=(0, 0), mask=nose)
imager.paste(im=eyes, box=(0, 0), mask=eyes)
imager.paste(im=eyebrows, box=(0, 0), mask=eyebrows)
return imager
def ICSayoriTap(image, strings):
characterString = strings[-1]
body = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_tapping_{strings[0].get()}_bodybase.png").resize((480, 480))
head = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_tapping_{strings[1].get()}.png").resize(
(480, 480))
mouth = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_tapping_mouth_{strings[2].get()}.png").resize(
(480, 480))
nose = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_tapping_nose_{strings[3].get()}.png").resize(
(480, 480))
eyes = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_tapping_eyes_{strings[4].get()}.png").resize(
(480, 480))
eyebrows = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/sayori_tapping_eyebrows_{strings[5].get()}.png").resize(
(480, 480))
imager = ImageTk.getimage(image)
imager.paste(im=body, box=(0, 0), mask=body)
imager.paste(im=head, box=(0, 0), mask=head)
imager.paste(im=mouth, box=(0, 0), mask=mouth)
imager.paste(im=nose, box=(0, 0), mask=nose)
imager.paste(im=eyes, box=(0, 0), mask=eyes)
imager.paste(im=eyebrows, box=(0, 0), mask=eyebrows)
return imager
def ICYuriTurned(image, strings):
characterString = strings[-1]
r = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_{strings[0].get()}.png").resize((480, 480))
l = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_{strings[1].get()}.png").resize((480, 480))
head = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_{strings[2].get()}.png").resize(
(480, 480))
mouth = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_mouth_{strings[3].get()}.png").resize(
(480, 480))
nose = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_nose_{strings[4].get()}.png").resize(
(480, 480))
eyes = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_eyes_{strings[5].get()}.png").resize(
(480, 480))
eyebrows = Image.open(
os.getcwd() + f"/assets/{characterString.get().lower()}/yuri_turned_eyebrows_{strings[6].get()}.png").resize(
(480, 480))
imager = ImageTk.getimage(image)
imager.paste(im=l, box=(0, 0), mask=l)
imager.paste(im=r, box=(0, 0), mask=r)
imager.paste(im=head, box=(0, 0), mask=head)
imager.paste(im=mouth, box=(0, 0), mask=mouth)
imager.paste(im=nose, box=(0, 0), mask=nose)
imager.paste(im=eyes, box=(0, 0), mask=eyes)
imager.paste(im=eyebrows, box=(0, 0), mask=eyebrows)
return imager