Skip to main content

ASCII art generator with multiple customization parameters

Project description

ascii-art

Description

Named as such, this package is a command-line ASCII art generator written in Python. There is a variety of customization parameters which are detailed below.

Installation

With Python installed, install the package from PyPI with the following command:

pip install ascii-art-cli

This package is not to be confused with ascii_art or other various ASCII art packages.

Usage

This is a command-line program, and can be executed as follows:

ascii-art [-h] [--output OUTPUT] [--width WIDTH] [--height HEIGHT] [--chars CHARS] [--font FONT] [--invert] [--normalize] [--terminal] input

Positional arguments:

input: Path to image from which ASCII art will be generated

Optional arguments:

  -h, --help        Show the help message and exit
  --output OUTPUT   Path to output generated ASCII art
  --width WIDTH     Character width of ASCII art
  --height HEIGHT   Character height of ASCII art
  --chars CHARS     String containing characters to be seen in ASCII art
  --font FONT       Font for calculating the character weights
  --invert          Whether the ASCII output color is inverted
  --normalize       Whether the weights of the provided ASCII characters are normalized
  --terminal        Whether to output to the terminal

Example:

ascii-art examples/images/einstein.jpg --width 100 --height 50 --font "Courier" --terminal --normalize
%%++%+++%%;+;%%+%%%%%S%%+SSSSSS+,'%++;'','''.''''.'''.'.''''.''''',,,,,,;;,,,'%S'+##@@@@#@@@@@@@@@@#
+++%;%+%%++%+SS%S%+%S%%SS%S%S%+,'S%;','....''... .............'.'',',,,;,;,',''+S,S#@@@@@@@@@@@@@@@@
;++%S%++%%++%++%%%%%%SSSSSS%%;,,SS',',..........................''.''';'',,,,',,;%%##@@@@@@@@@@@@##@
;++;++;++%%%%+S%%%SSSSSSSS%+%,;%S;+,..''............ ...   ...''..''.,',',;,,,'',S,SS@@@@@@@@####@#@
;;;;;%+;;+%%+S%+SSSSSSSS++%++%+SS,,;''.. . .... ....     ...'..'''.''','',,,,''',;#S%S@@@#@@@@###@@@
;++;;++%%+++%%%%SSSSSSS+;;,;S%SS,%,''....... ... ..   ..  . ..''.'''.'',,',,,'''',%;###S#@@@@@@@@@@#
+;,+%++%++%S%SSSSSSS%%.;%SS%+SS+%',;,'... .. ....... ..  ...'...'''''','',,,'',',';,#@@#S@@@@#@@@@@@
;;;%%+++%%+%%%SSSSS%,'S;%%+SS;#+;,'',....  . ... ... ............''''.'''',,'..'',+S%##@#S@@@@#@@@@@
;;+;+%;++%%%%SSSS%S%;S%S%++S+,#+,S##S+%'............',SS%'',..,..'''''.'''''''.',,'%+%#@@#S@@@@@@@@@
,+++;+%++%++%%SSSSS;S#;+;+%%;;#SS##SS,''. ........'.''.;%%%,;;.''.'''''''''''.''';;,%S+S####@@@@@@@@
.;;;;++++%++++SSS%%,S%+S,;SS,%#,%+,',,'''.. .... ... ..'.'..'.....',''.''',''.''';;++SSS###S@@@@@@@@
;%;+%+;%++%%%S%%S+%SS#,;+SS;,+#+;''''''......  .  ..............','''..'''''.'.';,;;;;SSS#@####@@@@#
S.+%%%;;%%%+%SSSSS#S#SS,+SS+;%#,''.,,,',,'...     .'.............'''''''''','.',,,;S+;%+#S@@@#@@@@@@
,,;%++;%%%+SSSSS#S###S+%%S%%;SS,.';;;;;'';,.    .....',;+S%,'....','..'''''....''',,%%+;%SS#@@@#@@@@
';,++%+%%%S%SS%##S#SSS;SSSS+,#S;';%S;+;.''%;..  ....'.';+,,,+,...',''''.'''.'...'',,;+;%,,S@#@@@@@@@
.%+%++%+%SSSSS#######S,SSSS%;#S;;S#. %%;+';S.  ...',';+S%#%',,'''','..'';.'''..''',';+;+;%%'#@@@@@@#
,,;++%%%%SSS########SS,SSSS,%#%,'S+.###%.,,S.....,'',;..###S;',...,''',',''''..'''+,,;+%,,%S#%@@@@@@
S+;+%S%%%SSS#####@##SS;SSSS,#S%,'%+,%S,,%,S,'...', ','''###.;''''.'''.''''''''',',,,;;;;+++%##S#@@@@
%,S+%%%SSSSS######S+#S%#SS#+#S%,S%SS;;'%.'S,...'''.',,;;,,';+,'''.''''',,,'''',;;,;;,+;,;+S++@@%@@@@
',SSS%+S#SSS####S##S@+,##S#+#S+%;,;%;,',;SS;.''''.'';,'',,,,,,',,..''.'''''.'',;,,,,;,;S,+%S+%@@@@@@
',SSSS#%SSS####S#####%S##S###%;%;,,,,,,,;S+.'.,'.'...',,'''.'',,'..','',,,,',,,,++%;,',,+';S+SS@S@@@
,%##SS#S#S#####S####%#SS#S###;;','.'',..SS,'.,,'''......'.'''''',''',,',,,,,;,;;',SS+',,,;,+S+##@#@@
;S#@###SS##########+#SS##'###%,''''..'.,S;'''',;,.'.. .....'.'...'.',,,,,,,',,%;''%,%%;;,;,;;;%#@#@@
+S@@####SS######S#;SSS###%###;'...;...,%+.''',,,,'..'... ..........,,,,;,+++';;'.,+;%#,,''',,;+####@
;#@@#@@#########S#S######S###;'..','','S'.....',;,'. ...... .. ...'';,;,,+%,+''..''#,,;,''',%,,S%#@@
S#@###@############@####SS###+.''''''.S%'.   ..,',,'.  .. ........',,+;,;+%,,..'.,,.,.#,..'',;'+S#@@
####@##@#@############S###S##+,''''..'%S,.  ..'''.,,'.    . ......'';%,,,%%,'....'..'.;%...',;',S@#@
;%@####@@####@####S#######S##%;,;'. .S%SS'..'','..';'.'    .......'',%,,;;++;,,.';,..',+...'%;',%#S#
S%####@#@##@@##@#########%S##+++,'..'';S#+,,,%.. ,,,...'..  ..'..+'',;,,;;%,..,',','.',+..'.++';;#@@
,+##@####@@@##@###@##,S+'SS##+,%'..',,;'''' .'.'''......'........'''+;,+,,+...,'%''.,'+...'.;+'%SS#@
%S@@, ###@#'#@@#####@##@#####,'%,''''''.....'.. '..',..'''...'.'...',,,,;,S'..;+;;;',,,..''.S%,%@###
S%@@@#########@@###@#@@#SSS##,'+',.,..  .'..,...'...'.''''....''..''+,,;,;+''';S;,;;;+'',',,%,%@S@##
%S@#@@@#@#@@#######@#####S###%'%,%;.',' '.... .''...,.''''+..'....',+,,,,+,.'';;##'',,'%%'.;%#######
#@@@###.#@@##@#@@##@#########S;%,;+%,,,'' .''.,..,,,','.'.'..'....',%',,,%#',;#@##%'+%;#S,S#@#######
S@@#@#@######@@####@#########S,+',;%#S%;%,%,++',SS,S;',.'.'.'.....',;,',;;S@@@@@@@@#S#@@#%S#########
#@@##@@#@###@@@###############,;;''%S#S#%#;S%%%+''%S+S+#..''..'.'.',%'',+%S@@@@@@@@@@@@#@###########
@@@##@@@##@@#######@##########;'S'..,SSS;%;,;,,,',%;%##%%'.'..'...';%.';+S@@@@@@@@#@@@#@###########S
@@@@@@@@#@#####@###############+,+..';#,.;,';',',,,;S#++',;..'....';'''%@@@@@@@@@@@#@###@#####S##S%%
@@@@@#@@@@#@#@@################;'%'..,#',,,,,;';',;SS,'..';.','...'%',%@@@@@@@@@##@#####@#######SS%S
@@@@@@@@@#######################,';. '#' ,';',,+'.%,;,,...,'',....+''#@@@@@@@@@@@@@@###@######@S#+%S
@@@@@@@#@#@###@#################S'+...#+'',,%,,+.%S+;,'..','',...',.@@#@@@@@@@#@@@###@@#######SS+SS+
@@@@@@@@@@@@#####################+'' '#+'.'.'%%,'%S%;.....'.;...,S'#@@@@@@@#@@@#@####@#####@#SS+S%SS
@@@@@@@@@@SSSSSS##################'S.'##, '',;+',S+,',....'.%..'+#@#@@#@@#@@#@@@#@@##@#@####%%+SS%SS
@@@@@@#@SSS%SSSS#############S####S'''%#,'.+,,,'%,','......'...;###@@@@@@##@#@@####@#####@SS%SSS+SSS
@@@@@@SS%SSSS%SSSS#################,S''#%'.,,;';+,'.... ...;.'S##@@@##@@@#@#@@#@#@@@#@@@#SS%++S+S%+S
@@@@%%SSS%S%S%SSS###################S;',#;,;',;S...''.. ..'''####@@###@@@##@#####@##@###S++;;S%SSSS#
#@%SS%%%S%%SS%S%SSS#######S#SS########;'##,,,,;'.....'...',########@@@@@#@@#######@@@##%%S%S%%S%#S##
SS%S%%%S%%SSS%S%%SSS#####S#S#S#########;'##++%.. ..'....'%####################@###@@@#SSSSSS%%%+SS##
%SS%S%%%%SSS%S%%SSSS######SS##SSS#######,,+S,. ... ....,############@###########@@@#SS%+%%#+%%S+S###
S%%%S+%%%%%%%%%S%%S###SS##SSSS###########;,''........,############@#############@@##S%SSSSS,%SSSS##S

Feel free to check out the docs for more information.

License

This software is released under the terms of MIT license.

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

ascii-art-cli-1.0.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

ascii_art_cli-1.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file ascii-art-cli-1.0.1.tar.gz.

File metadata

  • Download URL: ascii-art-cli-1.0.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/2.7.16 Darwin/19.6.0

File hashes

Hashes for ascii-art-cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4f766b4ab290566990df6d4950031bccb901dec87dc9a438aba9371dfbd286b0
MD5 2fefad0ce8c0759dabcf6f3a30558c9a
BLAKE2b-256 583698e0187f54ce6be6b87eb09c9a3fded14bf58fb299e846e7089aaadefa74

See more details on using hashes here.

File details

Details for the file ascii_art_cli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ascii_art_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/2.7.16 Darwin/19.6.0

File hashes

Hashes for ascii_art_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47d6eefe0ffa2b9a4e5ca107f3c3da0ba051539ce6a20cf1d23fead34e03857e
MD5 0fc86d2d795d510097ddccc0b08ed17d
BLAKE2b-256 179dc0e76a62d5a0110722dafb7e62d4cc98204c9753891963c41cd270321f68

See more details on using hashes here.

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