Skip to main content

asciifite 🎨

asciifite is a high-performance Python library for converting images and videos into colorful ASCII art and generating creative text banners for CLI applications.

By leveraging NumPy vectorized operations, this library ensures that frame-by-frame conversion is significantly faster than standard Python loops.


🚀 Features

  • Video-to-ASCII: Convert standard video files (.mp4, .avi, etc.) into colorful ASCII-style videos.
  • Image-to-ASCII: Transform any digital image into a detailed, textured ASCII rendering.
  • Creative Banners: Generate stylized, framed text banners using multiple "brush" styles (solid, thin, dotted).
  • Aspect Correction: Automatically adjusts character density to maintain the original visual proportions.

📦 Installation

Ensure you have Python installed, then navigate to the project root folder and install via pip:

pip install .

🛠 Dependencies

The library relies on the following industry-standard packages:

  • opencv-python: For media decoding and rendering.
  • numpy: For high-speed image matrix processing.

📖 Usage Guide & Examples

1. Generating Creative Banners

Use the BannerGenerator class to create stylized headers.

from asciifite import BannerGenerator
bg = BannerGenerator()
banner = bg.generate("ABC", style="solid", frame=True)
print(banner)

2. Converting Videos to ASCII

The process_video function handles reading frames, conversion, and writing the final video.

from asciifite import process_video
process_video(
    input_path="input.mp4", 
    output_path="output.mp4", 
    width=120, 
    cell_size=8
)

3. Converting Images

Turn any photo into an ASCII masterpiece with process_image.

from asciifite import process_image
process_image(
    input_path="photo.jpg", 
    output_path="ascii.jpg", 
    width=150, 
    cell_size=10
)

⚙️ Configuration Options

  • width: Number of ASCII characters across the output.
  • cell_size: The pixel dimensions of each character block.
  • charset: Choose between 'standard', 'complex', or 'blocks'.

📂 Project Structure

asciifite_project/
├── asciifite/            
│   ├── __init__.py     
│   ├── core.py         
│   └── io.py           
├── setup.py            
└── README.md

Release files for asciifite 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asciifite 0.1.0
File Size Uploaded
asciifite-0.1.0.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asciifite 0.1.0
File Interpreter ABI Platform
asciifite-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.5 kB

Release files / asciifite-0.1.0.tar.gz

Download URL asciifite-0.1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b992731f242edb4e4c7c1f77ce31c2efe2c9027a4747ef6a6baea2186bed14e1
BLAKE2b-256 checksum
How to use checksums
02460a32e7e8d16b208a6df47d6e67ab5b1f19b63db73c34c41062c5776aef11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / asciifite-0.1.0-py3-none-any.whl

Download URL asciifite-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f43bd7b88d8a0d8d7a0a12ea65b4d10dabe403ddefcd76c814bace8cc2f8911
BLAKE2b-256 checksum
How to use checksums
a52d7ebd9535fa2030eb84f4a4f6a654cb20bea5876d2648ff9a00e5750fe99f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page