Skip to content

a simple python script to convert images to ascii art. Supports both classic ascii and block characters, colors, inverting and edge detection.

License

Notifications You must be signed in to change notification settings

kimusan/pic2ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                                                                ,     ,
██████╗ ██╗ ██████╗██████╗  █████╗ ███████╗ ██████╗██╗██╗      (\____/)
██╔══██╗██║██╔════╝╚════██╗██╔══██╗██╔════╝██╔════╝██║██║       (_oo_)
██████╔╝██║██║      █████╔╝███████║███████╗██║     ██║██║         (O)
██╔═══╝ ██║██║     ██╔═══╝ ██╔══██║╚════██║██║     ██║██║       __||__    \)
██║     ██║╚██████╗███████╗██║  ██║███████║╚██████╗██║██║    []/______\[] /
╚═╝     ╚═╝ ╚═════╝╚══════╝╚═╝  ╚═╝╚══════╝ ╚═════╝╚═╝╚═╝    / \______/ \/
---------------------------------------->By Kim Schulz<--   /    /__\
                                                           (\   /____\

Image to ASCII Art Converter

A command-line tool to convert images (PNG, JPG, etc.) into ASCII art with optional color, block characters, and edge detection.

Features

  • Convert images to ASCII art with different character sets
  • Supports color output in the terminal
  • Block character mode for improved resolution
  • Edge detection to highlight image details
  • Invert mode to reverse brightness mapping

Dependencies

Ensure you have the following installed:

  • Python 3.7+

  • Required Python libraries:

    pip install pillow colorama

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/ascii-art-tool.git
    cd ascii-art-tool
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the tool:

    python pic2ascii.py path/to/image.jpg -w 100 -c

Usage

Run the script with an image file and optional parameters:

python pic2ascii.py <image_path> [options]

Options

  • -w, --width <int> → Set the ASCII output width (default: 100)
  • -c, --color → Enable colored ASCII output
  • -b, --block → Use block characters instead of normal ASCII
  • -i, --invert → Invert brightness mapping
  • -e, --edge <0-100> → Apply edge detection (intensity 0-100)

Examples

Convert an image to ASCII

python pic2ascii.py image.png -w 120

Convert an image with color

python pic2ascii.py image.jpg -w 80 -c

Use block characters for better resolution

python pic2ascii.py image.png -w 100 -b

Apply edge detection with intensity 50

python pic2ascii.py image.jpg -w 100 -e 50

License

This project is licensed under the MIT License.

Author

Kim Schulz / (https://schulz.dk)

About

a simple python script to convert images to ascii art. Supports both classic ascii and block characters, colors, inverting and edge detection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages