Convert images to ASCII art using Python.
- Converts any image to ASCII art
- Adjustable output size (default: 200x125)
- Outputs ASCII art to a text file
- Python 3.x
- Pillow (PIL) library
- Clone or download this repository.
- Install the required dependencies:
pip install pillow
Run the script from the command line, providing the path to your image:
python ascii_art.py <image_path> [width] [height]<image_path>: Path to your image file.[width](optional): Output ASCII art width (default: 200).[height](optional): Output ASCII art height (default: 125).
Examples:
python ascii_art.py example.jpg
python ascii_art.py example.jpg 100 60The ASCII art will be saved to ascii_art.txt in the same directory.
- You can change the output width and height by modifying the
WIDTHandHEIGHTvariables inascii_art.py. - The ASCII character set can be adjusted by editing the
ASCII_LEGENDvariable.
MIT License
