Skip to main content

ASCII art generator with multiple customization parameters

Project description

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 Git installed, simply clone the repository using the command:

git clone https://github.com/dawsonbooth/ascii-art.git

Usage

This is a command-line program. The main file, ascii_art.py can be executed as follows:

python ascii_art.py [-h] [--output OUTPUT] [--width WIDTH] [--height HEIGHT] [--chars CHARS] [--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     Path to 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:

python ascii_art.py 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

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-0.1.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

ascii_art_cli-0.1.0-py3-none-any.whl (6.9 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