Skip to content

Perezented/Python-Ascii-Image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This script converts an image to ASCII art. It resizes and grayscales the input image, maps pixel brightness to ASCII characters, and outputs the result to a text file. Usage: `python ascii_art.py <image_path>`. Requires Pillow (PIL).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages