A Python library and CLI tool for converting images and videos into ASCII art.
Project description
ASCII Art Python - Convert Images & Videos to Terminal Graphics
ASCII Art Python is a powerful tool to transform your images and videos into ASCII art. Export your creations as text, images, or videos (with audio) and play them directly in your terminal.
Preview
Below is an example of an image featuring the Python logo:
||||||*{{*||||||
///{{{****{{{{{{{{{{{\\
|{{//-\*{{{{{{{{{{{{{{{\
|*{*| |{{{{{{{{{{{{{{{{|
|*{{{*-*{{{{{{{{{{{{{{{{{|
\{{{{{{{{{{{{{{{{{{{{{{{|
----- /*{{{{{{{{{{{| -----
//{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{| |::::::\\
//{*****{{{{{{{{{{{{{{{{{{{{{{{{{{{{| |::::::::\
-******{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{| |:::::::::-
-{***{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{| .::::::::::-
-{**{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{// /:::::::::::
*{{{{{{{{{{{{{/----------------- .:::::::::::::
-{{{{{{{{{{{// .----------------:::::::::::::::::
-{{{{{{{{{{| .......::::::::::::::::::::::::::::-
-{{{{{{{{{{| |.....::::::::::::::::::::::::::::::-
|{{{{{{{{{| |....::::::::::::::::::::::::::::::/
\\{{{{{{{{| |..:::::::::::::::::::::::::::::::/
\\-{{{{/| |::::::::::::-----------:::::---/
|:::::::::::.\----------\
|::::::::::::::::::::::::|
|::::::::::::::::::.:::::|
|::::::::::::::::| |:::|
|::::::::::::::::\-//::|
\\::::::::::::::::::///
|||||:::::::||||
And below, an example of a video featuring Nyan Cat:
Installation
pip install ascii-art-python
OpenCV Note: This module uses opencv-python-headless. To avoid conflicts with opencv-python, it is highly recommended to use a virtual environment (venv).
Quick Start
1. Command-Line Interface (CLI)
# Display an image in the terminal
aap-echo my_image.jpg -m full_mode
# Export a video to ASCII (.mp4)
aap-export my_video.mp4 result.mp4 -l 100
2. Python Usageimport ascii_art_python as aap
# Convert an image (Hybrid Mode)
img = aap.full_mode.Image.from_path("photo.jpg", max_size=50_000)
print(img)
# Play a video in the terminal (Edge-Detection Mode)
vid = aap.old_skool.Video("movie.mp4", fps=15)
vid.print_in_terminal()
Rendering Modes
- New Skool: Density-based (classic shading).
- Old Skool: Edge-detection based (line art style).
- Full Mode: Hybrid combining sharp contours and shading.
Full Documentation
To check the complete API, class details, and advanced export options, visit: the doc.
License
Distributed under the MIT License. See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ascii_art_python-1.2.4.tar.gz.
File metadata
- Download URL: ascii_art_python-1.2.4.tar.gz
- Upload date:
- Size: 296.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4961b09a8dfa68a0aa14398086f3a91fe59db5c05aaa730bd94cff3d6e70e8b
|
|
| MD5 |
95c80af01ba6c407faa8a66e59ae1677
|
|
| BLAKE2b-256 |
e5e2c5b1846647196eb304018ecb7a1a920c18b8c691043e0e9f3afe8057e9dc
|
File details
Details for the file ascii_art_python-1.2.4-py3-none-any.whl.
File metadata
- Download URL: ascii_art_python-1.2.4-py3-none-any.whl
- Upload date:
- Size: 302.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56ce0a6e9604b01c5de9761070d0512533338b40289ca8b9df95552e2315e733
|
|
| MD5 |
b481f856888416f0ac54d32119f98e8f
|
|
| BLAKE2b-256 |
fb6e716a990015f2b0fb25cc4a6b25538aff8abf323a5b1c2207570809705d89
|