from main_script import img_to_ascii  #Imports the main script (Only needed if this isnt the main script)
    from pyautogui import confirm, prompt

    #import ctypes
    #ctypes.windll.user32.ShowWindow( ctypes.windll.kernel32.GetConsoleWindow(), 6 )


    def YN(_ask):

        ans = confirm(text=_ask,
                      title="Image2Ascii",
                      buttons=['Yes', 'No', "Cancel"])
        if ans == "Yes":
            return True
        elif ans == "No":
            return False
        else:
            exit()

    img_to_ascii(sys.argv[1], (YN("Do you want colors?")), False, [
        " ", ".", ")", "#", "@"
    ], (prompt(
        text=
        'How should the image be scaled? \n("100" = 100% of the pixels being used)',
        title='Image2Ascii',
        default=''
    )))  #[image,color(True/False),Just_Color_mode(True/False),Loading Sreen(True/False),[Ascii characters to use (in a list)],scale input(%)]
except Exception as e:  #If error, then it will display error message here
    #ctypes.windll.user32.ShowWindow( ctypes.windll.kernel32.GetConsoleWindow(), 9 )
    print(e)
    x = input("Stop")
Beispiel #2
0
try:
    import sys
    from main_script import img_to_ascii #Imports the main script (Only needed if this isnt the main script)
    img_to_ascii(sys.argv[1],False,False,["░","▒","▓","█"],"discord") #[image,color(True/False),Just_Color_mode(True/False),Loading Sreen(True/False),[Ascii characters to use (in a list)],scale input(%)]
except Exception as e: #If error, then it will display error message here
  print(e)
  x = input("Stop") #"─","┼","╬",
Beispiel #3
0
try:
    import sys
    from main_script import img_to_ascii #Imports the main script (Only needed if this isnt the main script)
    img_to_ascii(sys.argv[1],False,False,[" "," ",".","-","*","x","#","@"],"") #[image,color(True/False),Just_Color_mode(True/False),Loading Sreen(True/False),[Ascii characters to use (in a list)],scale input(%)]
except Exception as e: #If error, then it will display error message here
  print(e)
  x = input("Stop")
try:
    import sys
    from main_script import img_to_ascii
    
    #Set to either True or False:
    use_colors = 
    
    #Make a list of all the characters you want the program to use, from bright to dark.  (for example, ["░","▒","▓","█"]  )
    use_characters = []
    
    #Set a integer value of how much it should scale the image from its original size (100 would result in every pixel in the image being one character)
    #If you want it to scale automaticly like mode_color.py then just make it an empty string (""):
    use_scaling =
    
    img_to_ascii(sys.argv[1],use_colors,False,use_characters,str(use_scaling)) 
except Exception as e: 
  print(e)
  x = input("Stop")