Skip to main content

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

PyPI version Python versions PyPI Downloads License: MIT

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:

Example with the Nyan Cat video played in a terminal.

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 -h 100

2. Python Usageimport ascii_art_python as aap

# Convert an image (Hybrid Mode)
img = aap.full_mode.Image.from_path("photo.jpg", width=500)
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ascii_art_python-2.0.2.tar.gz (301.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ascii_art_python-2.0.2-py3-none-any.whl (305.1 kB view details)

Uploaded Python 3

File details

Details for the file ascii_art_python-2.0.2.tar.gz.

File metadata

  • Download URL: ascii_art_python-2.0.2.tar.gz
  • Upload date:
  • Size: 301.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ascii_art_python-2.0.2.tar.gz
Algorithm Hash digest
SHA256 2d2d3355a28c0b043df5b4fb1428250b9951410952782f4e1e8b26becfcc1723
MD5 fdec3159986d8f16d448073e2f62dcb1
BLAKE2b-256 e3794e3616744f0399b10354bd4825c11b02a034a3b574fd90f09e1c2e9e9789

See more details on using hashes here.

File details

Details for the file ascii_art_python-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ascii_art_python-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a45e020bb7450d5c787bfa00f042654c626fa22cf627b3a3f9a01cc56acee75
MD5 5f3e66858b594df41d468c02f6749dae
BLAKE2b-256 1a05d35f58f1b7180bc5aeba37f96ef966fd13b5c7b8ea5cad0cea278b85b1ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page