ascii-magic
Converts pictures into ASCII art
What it is and what it does
ASCII Magic wraps Pillow to convert images into ASCII art—text-based representations using characters to approximate image tone and detail. It loads images from files, URLs, the clipboard, or generates them via Gemini or SwarmUI, then renders them to the terminal with optional colors, to HTML files, or to image files with styled text overlays.
The package centers on the AsciiArt class, which exposes methods like to_terminal(), to_html_file(), and to_image_file() with parameters to control output appearance (columns, colors, monochrome mode, width ratio). It also supports optional image enhancement before conversion. The module exposes both class methods and module-level functions for convenience.
Use it for:
- Display images in terminal environments where graphics are unavailable or impractical.
- Generate ASCII art previews of images for web pages or documentation.
- Create styled text-art images with custom fonts and backgrounds using to_image_file().
- Integrate AI-generated images (via Gemini or SwarmUI) directly into ASCII art workflows.
- Test image processing pipelines by converting outputs to ASCII for quick visual inspection.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts images into ASCII art for display in terminals and HTML, supporting multiple image sources including files, URLs, clipboard, and AI-generated images via Gemini or SwarmUI.
Yes. Low install friction, active maintenance, MIT license, no known vulnerabilities, and a clear single-purpose design make it a safe choice. Install if you need to render images as ASCII art in terminals or HTML; skip if you only need static image manipulation (use Pillow directly instead).
Install
ascii-magic on PyPI
pip
pip install ascii-magicuv
uv add ascii-magicpoetry
poetry add ascii-magicInstalling ascii-magic
Before you install
Low install friction with a single runtime dependency (Pillow). Actively maintained with recent releases; last update in April 2026 with code refactoring and Python 3.6+ compatibility improvements.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both personal and commercial projects.
Quickstart
pip install ascii_magic
from ascii_magic import AsciiArt
my_art = AsciiArt.from_image('moon.jpg')
my_art.to_terminal()
Requires Python 3.6 or later. On Windows, colors may not display without Colorama; call colorama.init() before printing if needed.
Verify before relying
- Whether Gemini and SwarmUI integrations require additional dependencies or API setup beyond what the fact sheet indicates.
- Performance characteristics when processing large images or generating ASCII art with many columns.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Pillow |
| Maintenance | actively maintained — 124 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 526,979/month — #6,172 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ascii_magic-2.7.5-py3-none-any.whl
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
cowsayRenders ASCII art animals and custom characters…
copyleft · top 5,000 on PyPI
climageConverts images to ANSI escape code sequences…
permissive · top 15,000 on PyPI
artConverts text and generates one-line ASCII art…
permissive · top 5,000 on PyPI
rich-pixelsRenders pixel images and ASCII art grids to the…
unclear · top 15,000 on PyPI
asciitreeRenders tree data structures as formatted ASCII…
permissive · top 5,000 on PyPI
asciidagRenders directed acyclic graphs as ASCII art in…
copyleft · top 15,000 on PyPI
pycowsayDisplays text in a formatted ASCII art cow…
permissive · top 15,000 on PyPI
pyfigletRenders ASCII text as ASCII art using a variety…
permissive · top 5,000 on PyPI
graphttyRenders directed graphs as colored ASCII art in…
permissive · top 15,000 on PyPI
ascii-guardDetects and fixes misaligned ASCII art boxes in…
permissive · top 15,000 on PyPI