Skip to content

ASCII Art

aryan edited this page Jul 20, 2021 · 8 revisions

Function: image_to_ascii_art(img_path: str, output_file: str = "pywhatkit_asciiart") -> str

This is used to convert an Image to an ASCII Art form that is stored in a text file.
If the image that you want to convert is stored in the same directory where the python file is stored you can just pass the name of the file. If it is in another directory then you need to give the full Path to the file.

Same Directory: pywhatkit.image_to_ascii_art("Example.png")

Different Directory: pywhatkit.image_to_ascii_art("C:\\Example\\Example.png")

By default, the output is stored in pywhatkit_asciiart.txt, but you can change the output filename with

pywhatkit.image_to_ascii_art('Example.png', 'filename')

Clone this wiki locally