-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
31 lines (24 loc) · 1.36 KB
/
test.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
####################################################################################################
## Change These ##
####################################################################################################
IMAGE_PATH = "Images/NASA.jpg"
INTERPOLATION_COUNT = 1
VIEW_SCALE = 0.4
SOURCE_COLORS = ["BLUE / CYAN", "WHITE"]
####################################################################################################
## WARNING: Nerdy Code Stuff ##
####################################################################################################
from Helpers.shader import *
SOURCE_COLORS = prepare_source_colors(SOURCE_COLORS)
sample_image = shade_image(IMAGE_PATH, INTERPOLATION_COUNT, SOURCE_COLORS, VIEW_SCALE=VIEW_SCALE)
sample_image.show()
print("-"*30)
print("Do you want to save this image?")
print("[Enter Y to save it, anything else to exit]")
SAVE_IMAGE = input(">> ").strip()[0].upper() == "Y"
if SAVE_IMAGE:
print(f"What do you want to save '{IMAGE_PATH}' as?")
SAVE_NAME = input(">> ").strip()
print(f"Saving to Generated/{SAVE_NAME}.png")
final_image = shade_image(IMAGE_PATH, INTERPOLATION_COUNT, SOURCE_COLORS, VIEW_SCALE=1)
final_image.save(f"Generated/{SAVE_NAME}.png", "PNG")