Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.11 KB

File metadata and controls

48 lines (36 loc) · 1.11 KB

Python-Ascii-Image

Convert images to ASCII art using Python.

Features

  • Converts any image to ASCII art
  • Adjustable output size (default: 200x125)
  • Outputs ASCII art to a text file

Requirements

  • Python 3.x
  • Pillow (PIL) library

Installation

  1. Clone or download this repository.
  2. Install the required dependencies:
    pip install pillow

Usage

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 60

The ASCII art will be saved to ascii_art.txt in the same directory.

Demo

ASCII Art Demo

Customization

  • You can change the output width and height by modifying the WIDTH and HEIGHT variables in ascii_art.py.
  • The ASCII character set can be adjusted by editing the ASCII_LEGEND variable.

License

MIT License