Asciify
A command-line tool and Python library that converts images into high-quality ASCII art with optional color, dithering, and brightness/contrast controls.
Features
- Multiple Character Sets: Choose from simple, complex, braille blocks, or Unicode block elements
- Color Output: Full ANSI 256-color support for colored ASCII art
- Floyd-Steinberg Dithering: Optional dithering for improved detail representation
- Image Adjustments: Control brightness and contrast
- Flexible Sizing: Auto-fit to terminal width or specify custom dimensions
- Invert Mode: Swap light and dark for different backgrounds
Installation
From PyPI
pip install asciify-image
From Source
git clone https://github.com/visakhunnikrishnan/asciify.git
cd asciify
pip install -e .
Usage
Command Line
# Basic usage
asciify image.jpg
# Specify width
asciify image.jpg -W 80
# Use complex character set with color
asciify image.jpg -c complex --color
# Enable dithering with custom brightness
asciify image.jpg --dither -b 1.2
# Save output to file
asciify image.jpg -o output.txt
# High contrast black and white
asciify photo.png --contrast 1.5 --invert
# Braille art (requires Unicode-capable terminal)
asciify image.png -c blocks
Python Library
from asciify import ASCIIArtConverter
# Basic conversion
converter = ASCIIArtConverter()
ascii_art = converter.convert("image.jpg", width=80)
print(ascii_art)
# With options
converter = ASCIIArtConverter(
charset="complex",
colored=True,
dither=True,
)
ascii_art = converter.convert(
"image.jpg",
width=100,
brightness=1.2,
contrast=1.1,
invert=False,
)
# Convert PIL Image directly
from PIL import Image
img = Image.open("photo.png")
ascii_art = converter.convert_image(img, width=80)
Options
| Option | Description |
|---|---|
-W, --width |
Output width in characters |
-H, --height |
Output height in characters |
-c, --charset |
Character set: simple, complex, blocks, symbols |
--color |
Enable colored output |
--dither |
Enable Floyd-Steinberg dithering |
--invert |
Invert the image colors |
-b, --brightness |
Brightness adjustment (0.0-2.0, default: 1.0) |
--contrast |
Contrast adjustment (0.0-2.0, default: 1.0) |
-o, --output |
Save output to file |
Character Sets
- simple:
.:-=+*#%@- Basic ASCII characters - complex:
.",:;!~+-xmo*#W&8@- Extended ASCII for more detail - blocks: Braille patterns for high-density output
- symbols: Unicode block elements for solid fills
Development
Setup
git clone https://github.com/visakhunnikrishnan/asciify.git
cd asciify
pip install -e ".[dev]"
Running Tests
pytest
Code Quality
ruff check src tests
mypy src
Requirements
- Python 3.9+
- Pillow
- NumPy
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Metadata
Release files for asciify-image 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| asciify_image-0.1.0.tar.gz | 11.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asciify_image-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.2 kB
Release files / asciify_image-0.1.0.tar.gz
| Download URL | asciify_image-0.1.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7473b5acaae0b495263367d3e3f560574ce5fe2497924838ee84f53565301777
|
|
BLAKE2b-256 checksum How to use checksums |
fd0b1ac6b39881e6d4ddc45bf7deea775b16e130599dd7d0c38e5634bfb5489a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / asciify_image-0.1.0-py3-none-any.whl
| Download URL | asciify_image-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5af4bbcd22bdccae637f5cee7f7ec4837e6a0db488330166a13cf7be53713258
|
|
BLAKE2b-256 checksum How to use checksums |
454afc5e5c3472643ecef6fe7532dc8b3be4c25605720b427e9a0522bfa4fc7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for asciify-image 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.