, ,
██████╗ ██╗ ██████╗██████╗ █████╗ ███████╗ ██████╗██╗██╗ (\____/)
██╔══██╗██║██╔════╝╚════██╗██╔══██╗██╔════╝██╔════╝██║██║ (_oo_)
██████╔╝██║██║ █████╔╝███████║███████╗██║ ██║██║ (O)
██╔═══╝ ██║██║ ██╔═══╝ ██╔══██║╚════██║██║ ██║██║ __||__ \)
██║ ██║╚██████╗███████╗██║ ██║███████║╚██████╗██║██║ []/______\[] /
╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝╚═╝ / \______/ \/
---------------------------------------->By Kim Schulz<-- / /__\
(\ /____\
A command-line tool to convert images (PNG, JPG, etc.) into ASCII art with optional color, block characters, and edge detection.
- 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
- Convert existing ascii/Ansi art between cp437 and UTF-8 encoding
Ensure you have the following installed:
-
Python 3.7+
-
Required Python libraries:
pip install pillow colorama
-
Clone the repository:
git clone https://github.com/yourusername/ascii-art-tool.git cd ascii-art-tool -
Install dependencies:
pip install -r requirements.txt
-
Run the tool:
python pic2ascii.py path/to/image.jpg -w 100 -c
Run the script with an image file and optional parameters:
python pic2ascii.py <image_path> [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)-f, --format <direction>→ Select format direction to convert between.
Possible directions are:
cp437-to-utf8andutf8-to-cp437.
Input file is given as alternative to the<image>
and can be in either utf8 or cp437 format.-o, --output <out-file>→ the output filename if converting between formats
python pic2ascii.py image.png -w 120python pic2ascii.py image.jpg -w 80 -cpython pic2ascii.py image.png -w 100 -bpython pic2ascii.py image.jpg -w 100 -e 50python pic2ascii.py image.ans -f cp437-to-utf8 -o image.utf8This project is licensed under the MIT License.
Kim Schulz / (https://schulz.dk)