-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_examples.py
executable file
·55 lines (44 loc) · 2.43 KB
/
run_examples.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
from recolor import Core
def main():
# Simulating Protanopia with diagnosed degree of 0.9 and saving the image to file.
Core.simulate(input_path='Examples_Check/example_original.jpg',
return_type='save',
save_path='Examples_Check/example_simulate_protanopia.png',
simulate_type = 'protanopia',
simulate_degree_primary=0.9)
# Simulating Deutranopia with diagnosed degree of 0.9 and saving the image to file.
Core.simulate(input_path='Examples_Check/example_original.jpg',
return_type='save',
save_path='Examples_Check/example_simulate_deutranopia.png',
simulate_type='deutranopia',
simulate_degree_primary=0.9)
# Simulating Tritanopia with diagnosed degree of 0.9 and saving the image to file.
Core.simulate(input_path='Examples_Check/example_original.jpg',
return_type='save',
save_path='Examples_Check/example_simulate_tritanopia.png',
simulate_type = 'tritanopia',
simulate_degree_primary=0.9)
# Simulating Hybrid (Protanomaly + Deutranomaly) with diagnosed degree of 0.9 and 1.0 and saving the image to file.
Core.simulate(input_path='Examples_Check/example_original.jpg',
return_type='save',
save_path='Examples_Check/example_simulate_deutranopia.png',
simulate_type = 'deutranopia',
simulate_degree_primary=0.9,
simulate_degree_sec=1.0)
# Correcting Image for Protanopia with diagnosed degree of 1.0 and saving the image to file.
Core.correct(input_path='Examples_Check/example_original.jpg',
return_type='save',
save_path='Examples_Check/example_corrected_protanopia.png',
protanopia_degree=1.0,
deutranopia_degree=0.0)
# Correcting Image for Deutranopia with diagnosed degree of 1.0 and saving the image to file.
Core.correct(input_path='Examples_Check/example_original.jpg',
return_type='save',
save_path='Examples_Check/example_corrected_deutranopia.png',
protanopia_degree=0.0,
deutranopia_degree=1.0)
# You can also use different return types and get numpy array or PIL.Image for further processing.
# See recolor.py
return
if __name__ == '__main__':
main()