forked from TechVine/ASCII-ART-using-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_to_ascii_art
41 lines (27 loc) · 1.34 KB
/
image_to_ascii_art
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
import ascii_magic #Importing the ascii_magic module in the code.
#Functions defined to perform the operation for image to ascii art generation.
def hack():
hacktober = ascii_magic.from_image_file("Hacktoberfest.jpg", column=100, char="#")
ascii_magic.to_terminal(hacktober)
def tv():
tech_vine = ascii_magic.from_image_file("TechVine.jpg", column=100, char="#")
ascii_magic.to_terminal(tech_vine)
print("\n-----------------Hello! Welcome to the Hacktoberfest 2022---------------------\n")
print("--------I have developed this code to contribute in Hacktoberfest event---------\n")
#Providing the choice to choose the specific image generation by looping.
while True :
ch= input('''\nEnter your choice to perform following image to ascii art generation.
Type "hack" for Hacktoberfest\n
Type "tv" for TechVine\n
Type "exit" to Quit\n
Choice:\t''')
if ch == "hack" :
hack()
elif ch == "tv" :
tv()
elif ch == "exit" :
quit()
else :
print("Invalid Choice! This option doesn't exist")
continue
#------------------------------------------------End of the Program-------------------------------------------------