Convert images to ASCII art
Project description
PixASCII
PixASCII is a Python-based tool that converts images into ASCII art. It works universally on Linux, macOS, and Windows as long as Python 3 and Pillow are installed.
Features
- Convert images to ASCII art
- Resize images for better ASCII output
- Save ASCII art to a text file or print to terminal
- Cross-platform: Linux, macOS, Windows
Requirements
- Python 3.7 or higher
- Pillow library
Install Pillow if you don’t have it:
pip install Pillow
Installation (Universal Method)
Clone or download this repository.
git clone https://github.com/hent83722/pixascii
Make the Python script executable:
chmod +x pixascii.py
(Optional) Make it a global command on Linux/macOS:
mkdir -p ~/.local/bin
cp pixascii.py ~/.local/bin/pixascii
chmod +x ~/.local/bin/pixascii
Make sure ~/.local/bin is in your PATH:
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Now you can run pixascii from anywhere.
Using the provided install script (Linux/macOS)
chmod +x install.sh
./install.sh
This will:
Copy pixascii.py to ~/.local/bin/pixascii
Make it executable
Ensure ~/.local/bin is in your PATH
Usage
Basic usage:
pixascii <image_path> [-w WIDTH] [-o OUTPUT_FILE]
Options
<image_path>: Path to the input image (required)
-w WIDTH: Width of the ASCII output (default: 100)
-o OUTPUT_FILE: File to save the ASCII art (optional, prints to terminal if not provided)
Examples
Print ASCII art to terminal:
pixascii /home/user/Pictures/photo.png -w 120
Save ASCII art to a file:
pixascii /home/user/Pictures/photo.png -w 120 -o ascii_output.txt
Notes
Adjust WIDTH to fit your terminal or desired output size.
If the output looks stretched, try changing the width or modifying the ASCII_CHARS in the script.
On Linux, make sure you refresh your shell if you previously installed an older version:
hash -r
License
This project is open-source and free to use. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 pixascii-0.1.2.tar.gz.
File metadata
- Download URL: pixascii-0.1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f80008b325fd628dc9ed386634b8a176afa31b94d4c431fab9205431bd2c3c37
|
|
| MD5 |
31d908e85492cb605623cafbc874345e
|
|
| BLAKE2b-256 |
0427701bf72dcc1f0f6c708374d739fb5afa0f031a8892ed17b994971493a510
|
File details
Details for the file pixascii-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: pixascii-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b5666313ddd67ce28c6c28da8b1d5954177ee2e8f52692b42108791bdc39cd0
|
|
| MD5 |
a919359789d0a9bc142cfd047d48a992
|
|
| BLAKE2b-256 |
768519418a018ae101f55f47a067e46443df4969bc03d56a99edcde2a0f69085
|