Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pixascii-0.1.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pixascii-0.1.3-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pixascii-0.1.3.tar.gz.

File metadata

  • Download URL: pixascii-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for pixascii-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b84ebdf210d67bd3b73081f6aa8fd084a336b193777cb60a56a985e71f839cfb
MD5 35fd91e8bd2bb07f6b9e08847ecb5670
BLAKE2b-256 7162d66ba8fba3867df85ac0a5d36151f478e300fb324f753506999eead37e7a

See more details on using hashes here.

File details

Details for the file pixascii-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: pixascii-0.1.3-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

Hashes for pixascii-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f56aa4d86b888d5f3def1f2f7a0e78de9911128267fa301eceef6d80d01a244d
MD5 9258f2070d702ca06fc8721642a3ff23
BLAKE2b-256 34ed9374cfb94f61a9a75f273390ea5ec59da38ed5f9379c530a162257bbeb40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page