Created
January 6, 2021 14:07
-
-
Save JayantGoel001/b680358e32b2f7909957c67238a32537 to your computer and use it in GitHub Desktop.
Convert image into ASCII Art
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pywhatkit as kt | |
import matplotlib.pyplot as plt | |
filename = input("Enter the filename : ") | |
target_image = filename.split('.')[0] + ".txt" | |
img = plt.imread(filename) | |
plt.imshow(img) | |
plt.show() | |
kt.image_to_ascii_art(filename, target_image) | |
with open(target_image) as f: | |
text = f.readlines() | |
for i in text: | |
print(i[:-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ %$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ %%%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ %%%%%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ %%%%%%%%%%%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ %%%%%%%%%%%%%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$%%%$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$@@@@$$$$@@$$$$$$%$$$$*%$%@@$$$$$%%**%$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ @@@@@@@@@@@&&&@@@@@@&#&@$$%%%$$%!!%%@@@$$$%%**!%$%%%$$%%$$$%$$$$$$$$$$$$$$$$$$$$ &&&&&&&&&&&##&&&&&&&&&##%%%*%$$%!!*%@@@$$$%%****%%$%$$**$%%%$$$$$$$$$$$$$$$$$$$$ #################&&#&&#&!!%**%$%!!*$@@@@$%%*****$$$%$$*%%%%$$$$$$$$$$$$$$$$$$$$$ ################&%*@####!!*****%*!*$@@@@@$%****%@@$$@$%$$$$$$$$$$$$$$$$$$$$$$$$$ &###############&*!*%&##%!!****%***$@@$@@$*$*%%$$%%$@@$$$$@$$$$$%%%%$$$$$@@@@@$$ &&&&&############@**!*%&#*!***%%%**%$%$@@%%$*%%%*$$@$@@$$@@%%****%*%$$$@@&&&@$$$ &&&&&######&@&####@%**!*$@****%$$%***%$@@%$@*%%*%$$%$@$$@@%**!!!***%$$$$@&&@@$$$ &&&&#######&!!!*$&#&%***!*%%%%$$@@%%*%$@&$@@%%%*@$$$@@@@@$%*!!!**!!**%@###&@@$$$ &###########&*!!!!*%$%*%%***%%$@@&@$%$$&&@&@%$%@$$$@@@@$$%!!!**!!!*%$@#S##&&@@@@ #######SS#####%!!!!!!**%%$$%*%$@@@&&&@@&##&@$@$@$@@&&@$%*!!*%****$@@@&SS#&&&&&&& ############@%%!!!!!!!!!%$$@$%$@@@@&@$$$@@@@$@@&&&&&@@%***%%*%$@&&&@&&$%%%%%@### #####&*****%*!!!***!***!*@&&&@@$%%%%%%%%%%%%%%$@@&##@***$$$$@&&&&&&&&@$$%*$&#### ######@*!!!!!!!!!!*******%@##@%**%%%$$%$$%%$$$%%$$$$%%%@@@&&&&&&&&&&&&@*%&###### ######SS#@%!!!!!!!!!!!*%$$$%%**%%$$$@$@$@@@@@@$@$$$$$$@&@&@@@@@@@&&&&&&&######## #&@$%***%%%*!!!!!********%%**%%$@@$$$$$$$$$@@@&@$@@@@@@@@$$%%$$@@@$@@&&&&&&&&&&# ###&&$%************%%%%$$***%$@$$$$$@@@&&@&&@&&&@&@@@@@@$$%%%%*********%%$$$@&## ##&@@@$$$$$$%%%%%%%%%$$$%**%$@$$$@&#SSSS#S#&&&&&&&&&&@&&&%***!!!!!!!!!!!*%%$$@## @%*****%%$%%%%*****%%%%%**%$@@@$@#S#####&@####&###&#&&#&&$***!!!!!!!!***%@@$@### #&%!!***!!!!!!!!!*****%%*%%$@$$$#S##@&&@&@&&SSSS####&&&##@*****%%$$$@@@&&####### &&@%**%%**************%**%%$@@@@S##&@@@$@@@@&##SS###SSSSS#@$$$%%%$$$@@@&######## &&@%%%$@@%***!*!******%%*%%$@@&&&&&@@@@@@&@@@@&#SSS#SSSSS&*!*%%$$@@@@&&&&&&##### &@$%%%%*******%%%%%%%$@$%%$$@@&&&#&@@@@@@&$@&@&##S**SSSS#%!!!!!!!!**%%$@@&&&&&&& &@%%****%%%%%%$$$$$@@$$$%%%$$@&&&&&@@@@@@@&SS###SSSSS**S@***!!!!!!!!!!!!!*%$@&&& @$%***%%%%**%$@@@@$$%****%$$$@&&&&&&&#####SS**SSSSS***S&$!!!*!!!!!!!!!!!!*%$@&&& &@$%%%**!**%$$$%%*!!!!!*$$$$$@@@&####SSS#SSS***S*SSS**#&@*!!!!!!!!!*%$$$$$@&&&&& &#&$*!!!!***%%*!!!!!!*$$%*%@@@@&#&##SSSSSSS*********S&%$$**!!!!!!!!!!*%@@$@&&&&& &##&@$$%*%***!!!!!*%$@%**!*%$@&&&&##SSSSS*********S#%!!!!**%%***!!!!!!!!%@&&&&&@ &&&&&@$$%**!!!!*%$@@%***!!*!*%&##&###S*SSSS***SS#&@%!!!!!!!!*$$$@@@&@$%**%&##&&@ &@@@&&&&&$***%$@@$%*!**!!!***$*$$&SSSS*****SSS$****!!!!!!!!!!*%$@@&&&&&#&&&####& @@@@&&#@$%**%%%%*!!**!!!!*%*$%***$%%@@@@@@@%%*!!!!!!!!!!!!!!!!!*$@@&&&########&# @@@@@@@%**%%***!!**!!!!%%%*%%*****!!!!!!!!!!!!!!!!!!!!!!**!!!!!!%@@@&&&&&####&@& @&&@@@&###&@%**!!!!!!*%%*%$%*!****!!!!!!!!!!!!!!!!!!!*!!!%$$%*!!!@&@&##&&#SSS#&@ &&&#&&&###&$*!!!!!!*%%*%$$%*!***%!!!!!!!!!!!!!!!!!!!!*****%@@&@$*%&&&##&&&###### ########&&&$%%*!!!***!%@@%*!***%%!!!!!!!!!!!!!!!!!!!!!%%%$$$@&&&@@@@&&&&&@&&#SS# ########&&&&&$!!!!!%%!@@$*!**!%@**!!!!!!!!*!!!!!%*!!**%@%$@&@@&&&@&##SS#&&@@&@@@ #&&@@&&&&&&&@$%%%**%*%&@%!***$&@**!!*!!!!*%!!!!!$$%!***&&@@&#&&&#&##SS#&&&&&&&&@ #&@$%$@##&&&@@@@$$$$%$&@**$%&#&@%**!%*!!!$$%!!!*#@@@%**&&&&#####S#&&&&@@&&&@&&&& #&@$$%@&&@@&&###&&&&&&&$%@&&&@@&$%**@%!!%@@$$!!%SS&&@$@#&&######S#&@@@$@@@@$$$$@ &&&&@@@@@$@&##########&$@&&&&&#&&*$$&@*!&##&@$*&S*S&&&##&&&&&&&&&&@$$@@@$@@$$$$@ &&&&&&#&@$$@&#####&&&&&&&######&&&&@@@@$####&@$&S**#&#&&&&&&&&&&&&&&&&&&@&&@&&@$ &&@$$@&&@$$@&#########&&&##########@@&#####&&&&&#**##&####SSSSSSS####SS######&@$ @@$%%$@@@@@&###&&&##########SS#####S#######&&#S#&S*S#&S**S##########SS#S*S###### @$%%%$@&&&####&@&&###&&#####S######SSSS########S#SSS###SS#&&###########S*SSS#### &@$$$@&###S###&&&###&&&&&&#######&&#############SS*S##S#######S######&#SSS###&&& #&@@@&##SS###########&&&&&####&&&@@@&&#######&&@&S*S##S###############SSSS##&@$% ###&&&##SS############&&&&####&&&&$$@&#&$@$%%***$S*S#&###############SSSS###&&&& ##&&@@&##SS###########&&&######&&&@$$%%%********&S*S###SS####&&&&&&#SSSSSS###### #&&@@@&&###S########S##&&&&&@&&#&&&@$@&##&@@%*!$#S*SSS#SSS########SSSSSSSS###### ##&&&&#########&#####SS#&&&@@@&###&&@&SSS####@*$#S*SS##SSS&&#####S*S##SSSSS##&#S &&&####SSS###S#&&&&###SS#&&&&&&###&&@&SS**S###@%&##S##SSS#&@@&##SSS##SSSSS#&&&S* &&####SSSSS##SS#&&&####SS####S#####&@&##S**S###$@&@##SSS##&&@$@#SSSSSSS#&&S#S*** &####SSS#####SSSS##S###SSSSSSSSS###&&&###S**S##&&$@######&&&#&$$&####SS&$@SSSS*S &S#####&##SS##S***SSS##SSS####S####&&&S###S**SS##$@###########&@$@&@@$$$%$$$$@S* #*########SS###SS**SSS##SSS#&&####&&&#S####S**#&&%@##SSSSS####@$%%%%$%$$@@@&##S#