Skip to main content

An image-to-ascii-art converter

Project description

<(||') asciibee <(||')

An image-to-ascii-art converter

Description

The default settings are tuned to work best with fine art. Play with different shaders, chunk sizes, and value inversion for different results. Remember to decrease your font size if you can't see the whole image.

Scaling is accomplished by dividing the image into chunks and converting each chunk to a single character. The chunk size can be adjusted with the -c flag. The chunk size defaults to the pixel width of the image divided by 100. The output will tell you what chunk size was used.

Installation

$ pip install asciibee

Usage

The best way to learn how to use the app is via the help text:

$ asciibee --help

The most simple command is passing in a path to an image file:

$ asciibee ~/Downloads/starrynight.png

You can use it as an importable module as well.

from asciibee.image import AsciiImage
image = AsciiImage('/Users/jnakama/Downloads/port.jpeg')
image.convert()  # Converts the image to a matrix of ASCII characters
image.ascii_matrix # It's stored here
image.show()  # Prints the characters

Development

The build system and package manager is poetry.

The easiest way to run the app locally:

$ poetry run python -m asciibee.main <path_to_image>

You can also install the deps and run it without the poetry run prefix.

                    ...         .....             ......
                   ..,,-,.         ..,.        ..,,....
                      ..,-..         .,,.     .,..
                         .-..         .,-,,..-..             ......
                          ..,,.      .####+###+..         ..,,,,,,..
                            ..+-..   -+@@@##@@#+  .....,,,,,.
                              ..,---.-++++++#+#-.,--,,,....
                                 ..-#++#######++#+,.
                        .  ..      ,#++@@@@#@@@#+..            ...
                    ..,,-,-,-,,,..,-++##@@##@###+++-,,,..,,,,,,,..
                      ......,,,-++++#+###########+++----,,,... .
             .....,,,,,,----------+++-###+#++#+++++----------,,,,,,......
       ...,,,-,,,,,,,,,-,,,,--------+-..#####-..,+-+----,,,-----,-,,,---,,,,....
    ...,,,,,,,,,,-,,,,,,,,,-,--,,--,.-+########+-,--+-----,,,,,,,---,,--,---,,,,,..
  ..,,,,,,.,,.,,,,,,,.,,--,,,,-,--..-+####@@@@@##-.,-+-,,,--,,,,,,,,--,,,,,,--,,,,.
  .,,,,,,.,.,,.,,,..,,-,,,,,,,--+..,++++++++#####+-.,----,,-,,-,,,,,,,,,-,,.,,,-,,.
  .,,,,,,.,,,.,,,,,,,,,,,,,,-,-+. .+###++#####@###+...---,,,,-,,------,,,,,,,,,..
    ...,,,,,,,.,,,,,,,,,,,,,,-,.  ,#@@@#-+###@@@@@#,   ,-,,,,,,,,,,,,,,,.,,....
                ..........,-,...  ,+##++++###@@@##+-.    .,,,.....   .
                     ..,-,...     ,+##++#++++######-.      ..,..
                    .,,,...       ,#@@##+##@@#@@@@#-.        .,,.
                   .,,.           .+####++#@@@@@@#+..         .,.
                   ...            ..+++++++######+,.          ...
                                    .+###++####@#-.
                                     ,+##+######-.
                                     ...-##@#+-...
                                        ..--...

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

asciibee-0.3.2.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

asciibee-0.3.2-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

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