-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMethodChecker.py
35 lines (31 loc) · 879 Bytes
/
MethodChecker.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
from methods import do_method
from PIL import Image
import json
CONFIG:json = json.load(open('config.json'))
INTENSITY = CONFIG['intensity']
WIDTH:int = CONFIG['width']
LENGTH:int = CONFIG['length']
METHODS:list=[
"alpha",
"static",
"tstatic",
"shadow",
"light",
"test",
"test2",
"default"
]
if __name__ == '__main__':
test_image = Image.open('a.jpg')
if CONFIG['resize']:
test_image = test_image.resize((WIDTH, LENGTH)) # Sets size exactly
else:
test_image.thumbnail((WIDTH, LENGTH)) # Fits into the size
for method in METHODS:
rgba = test_image.convert("RGBA")
print(f'> Making image with method {method}')
new_data = do_method(method, rgba, intensity=INTENSITY)
rgba.putdata(new_data)
rgba.show(f'Test {method}')
rgba.close()
input("enter to continue")