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
Release history Release notifications | RSS feed
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.1.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for ascii_art_cli-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d43d59ab60be662de1f0f16e14fe7e529430f487973c507c38f36c1ce4b5e94 |
|
MD5 | 6b63eaf879664113804647501b668ab0 |
|
BLAKE2b-256 | b5b19c361e2dee9fc9a3c8f5aabf778e16d6e4bddb2ec7bde775670487a76deb |