Convert images to ASCII art
Project description
pyimg2asciii
Convert images into ASCII art with a simple Python library.
Installation
Terminal
pip install pyimg2asciii
Google Colab
!pip install pyimg2asciii
Usage
Example 1: Print ASCII art in terminal
from image2ascii import convert_image_to_ascii
# Convert image to ASCII
ascii_art = convert_image_to_ascii("input.jpg", new_width=80)
# Print result
print(ascii_art)
Example 2: Save ASCII art to file
from image2ascii import convert_image_to_ascii
ascii_art = convert_image_to_ascii("input.jpg", new_width=100)
with open("ascii_output.txt", "w") as f:
f.write(ascii_art)
Parameters
image_path(str) → Path to input image.new_width(int, optional) → Width of ASCII art (default: 100).
Example Output
If you run the library on an image, you’ll get ASCII art like:
@@@@@@@@@@%%%%###****
@@@@@@%%%%####***+++
@@@%%%####***++++=--
License
MIT License © 2025
Created by D.Abhiram 😊
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
pyimg2ascii-0.5.tar.gz
(2.6 kB
view details)
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 pyimg2ascii-0.5.tar.gz.
File metadata
- Download URL: pyimg2ascii-0.5.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed2e5670cf45e6fd52e69b085a18c06409bb5820ea5af6d2584ddd207bd801ed
|
|
| MD5 |
cddc626fc256b3f3742a9aaafaeb42bc
|
|
| BLAKE2b-256 |
d1a8148537d2e370ec9c5ffe9974650abd9c75bb9a50a7f5697a820ea60f96f9
|
File details
Details for the file pyimg2ascii-0.5-py3-none-any.whl.
File metadata
- Download URL: pyimg2ascii-0.5-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e067cf1ab57ed2b4d736419fd8747f2af46aa95e7a2ca313b6f2027a130457a4
|
|
| MD5 |
b333717089323789f022a2542323190e
|
|
| BLAKE2b-256 |
294f1456726dbe40a0c298a3611c9cb5992b2fd062b4f15a692d80c512e1e80e
|