Convert images to ASCII art
Project description
pyimg2asciii
Convert images into ASCII art with a simple Python library.
Installation
pip install pyimg2asciii
Usage
Example 1: Print ASCII art in terminal
from pyimg2asciii 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 pyimg2asciii 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.2.tar.gz
(2.5 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.2.tar.gz.
File metadata
- Download URL: pyimg2ascii-0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4433f6410278c38b5df4d1a345c20f7abb53a7e5d408229745ea54942a16dc1
|
|
| MD5 |
81a6c0185e0ab8c8e99631cb6fa06812
|
|
| BLAKE2b-256 |
fecf9edab4896cc2f232748e0e8fb80292a7aac7f8b0ba143e0bd671975328a7
|
File details
Details for the file pyimg2ascii-0.2-py3-none-any.whl.
File metadata
- Download URL: pyimg2ascii-0.2-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 |
11dce2552e34e91799b3db30c7786fcb26c5ade49fc39c6631d3e502d2b3bfa9
|
|
| MD5 |
ee37ccacd7787ab1eeb3d933c0af7034
|
|
| BLAKE2b-256 |
8fcf213789dc1351bc61b30b9eeb847e0396986c4541fa8551d1b3d0911d7e93
|