Skip to content

eifachnurtobi/AsciImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Examples

Daft Punk album cover

Daft Punk Ascii art

The GitHub logo

GitHub Logo Ascii art

Demonstration of grayscale

As Ascii art:

Grayscale Ascii art

Original:

Original grayscale image

How it works

  1. Converts the image to grayscale
  2. Resizes the image to have a width of 900px
  3. Takes a group of 9x20 pixels

Equal to the dimensions of a single character in my case (Using Consolas, 16pt)

  1. Takes the average brightness
  2. Matches the area to the letter whom's grayscale is the most similar

Test it yourself

You need Python Pillow to run this script. pip install Pillow

Convert.py -f "my/file/name.png"

Arguments

-f

File to convert

-w

Width of output image in characters

-c

Add additional/Remove contrast [Default is 1, higher = more contrast]

-ea

Include extended ASCII range

-i

Inverts the image before converting

-b

Block certain characters from appearing in image Example: python Convert.py -f "my/file.png" -b "&" "Q"

Sidenotes

May not work as well with fonts other than Consolas

Images that have extreme ratios (like 50:1) may not work

About

Converts images to ascii art with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages