ASCII Art

From Media Design: Networked & Lens-Based wiki
(Redirected from ASCII art)
Jump to navigation Jump to search
apt-get install python-aalib

See PETscii

import aalib, sys, Image, ImageOps
imgpath = sys.argv[1]
screen = aalib.AsciiScreen(width=80, height=40)
image = Image.open(imgpath).convert('L').resize(screen.virtual_size)
image = ImageOps.invert(image)
screen.put_image((0, 0), image)
print screen.render()
==|||+++__<z1*XZY++"|!`+<|=___:+!3X##ZZo3osi_.  :..   -.:.-.. ........---..:.   
=|>-=|i|<nqp2*}:.%><i;+|;:;<1vXXSYXmZ##mqXSoSas_=>:  .._.::. ::........:...:    
=||=|=<amXnc}si=s,is=; %suWB#gawaa21SSXX#XZXXXoal||iil>:=_==:. ..............   
.:+<+Il*1i%=<<owX2v+=a#ZSYVY1UA#U$W#XapZenZXXdZXXmXXooa>=,_.  -...... ......    
;===iz{il%viawmm#}%%JmeozvX#mmmmX#XXXXXXZZXoSXXXmX#m##Xe|+=.:. ..-.. .... ...   
=|=%|i%iInnnwwdQ2nv=ZZowmWWZ##ZSv1vvlilIvvvI1II12XXXXZXoi.. . . .... .......    
:={|<vnnXXmmmqW$mZvv#omQm#ZXZX11ii|||||+|=+i%}*|iivvnXmZXo>.. ......... . ..    
==|=vnoodXoX##audpod&mWW##XXo1li>+|====;=<>+==<|l=i+|iX#ZUXa;..  .  .... . ..   
:=%vsad#mmmB$8XXWhX#Z#B#ZZXoII|==+==;=>++:==>+====|+==|3##XXz|:... ... .. ..    
.ilo21YYZ#m#D2mmDXmQm##ZZX2ov|i+||==+=:;;i+(====>|.=vnooSZZZous==.. . .. . ..   
iIISo#ZZAYXoXXY!qmWWW#XXXXv%l>|====||>>+|====>|=<inXS111ldmXSX%s;+.:  . ....    
S1e}++sa><uenwmWWQWQWmZSSov1i|<>|=====|==:=++==ioXI*+++==+3mZ#oav;;:;... . .    
X2<_owoZcv+mm$WWBmWQW&ZZe1n%iii=|++==+=;==+==||Ii+=;======<V##Xoov%;==:-.. ..   
S(|oXnXX2n>$#qWW#mWBXd2vu1i%l+|=|=+=+=|==||||||+::;;=%wona>=$m#ZS1nai|=::.-..   
vnvoSoXXXnXmm#ZXm##XXn21u1i>|||+<uoool||ii|||>=;:;=<oXmm1vc+)$mmX1XoXs%>;::..   
oXonnSdXoXS#mq#mUX#X2on1vIiasaaoqXY*i+--+=+|=+====|vi=!"X%|==)QWQQmZZXo2s;;::.  
S2XXoo3ooZSmmmm#mZZX221unoXXSX21*++=;::::;:==+:=||swauI}-;:===)QWBm#Zoonvoa,;.  
voXoX2XXSoWWmmmm##ZXXXoo2XX21ii||+===+|||=||l%|=|%nvvi>==+=====]QWm##mmociI1oi_.
v3n2odX2dmmmm###ZZXZo2ood1lii|||saauoav%ioooon>===||i|=====|=;=;3mm####X2n%|i+<%
iunnXXnmXm#mBmmZZZZZX22o2vi|||i321#QZqvwwuXSnvi+=;;::=||+||===;;=VWmZmXXo2Xzi:=)
iI13voXZ#XU#mm##m#ZX2Xoonvi||voS|+!!{X11In21vI>|+==;==:======;:;:=X#W#moo2Svnvs,
vnvZoZ#UX##Z###mm#XXSooonIii|nXouvv}|++i|llIl%i|i>|++=======:::::=]WmZUXpu+lvIli
%oXoXXSX####mZWWW#mX2ooovvliiiIli|+=+====Iliiiiili|>+===;:={|>::;;<dmW##mqaini+{
vnXdXdowZXmmmmmmWW#mXXooovIl|iii|||=====ii|i|ivvvv|======;=<vva===<3m#W#m#1>"s:+
|3nXod#Sm#m#mmWmWWWmmXo2ovIii|||||+=||ii|||+<oo1li||||+=--:mmmZmo>|l#Q##WZ2c|v.=
=vnnXXZZdXmWWWmmQWmWQm#Xoonlli||||||<=+|||=;IXS||||||||;=<yQQWWUmmciXm#WmXoo|=  
=onnX2SX###W#WWWWmQQQQQmXXovvii|||||+|=+;==ilvnnawmmmwaauQWWQWU#Q#GvXWWWmm#p=|:_
|1nvonXXdX####mWWQQQQQQWmZSovvliii||+++++=|i2ZmXmQWWQQWQQW#WDSm2XXudZQWWmmmXXi. 
::v2vdXXXX####W$WQWQWWWQQQmXXvvvlii||||+++<vqXm#mWWWQQB#Z|iyW#e1InXm#QWQWQZXYv1<
 :<lu{oX1#X#m#$#QWWQQQQQWWW#moovvvlli|=++=vdZmWWWW#UZTmmwdQW#X1sinomBWQWWW#X1|lo
..:vvoZln2XXmXZW##WQQWQQQQWQmmXXnvvllli||iommWWW##SqyWmm#W#XS1liivmmQWQQW#WZS|vo
 -+|l3niu2oX#XZ$WmQmWWQWWQWWWWWmmXXnonvivvXXWB#B$Z###XXXXX11%{uqon#WWQW#mWZ#S2nX
  :=|vnv1nSXZ2Z#WWm$QmQQQWQQQQWWmmZmXoonnoom##WXn2XnSnSonvlaumQZSommWQ#Q##XXnIvX
 =<1svIvi3vdXoX##WWQ$QmQWQQQQQQQQWm#m#UXSXmXX##XXvIvIvvvoXX#WQX2XZmQWmW#XXoSu|]#
  -=:-:<>dS12Z3XmWWWQZmmQQQQQQQQQQQQWmm#m#mZmm##oXvonIvv2XoZW#qmmWQQ#md##X1)na%d
  :--.=iidsInvXZ#WWQWQZWQQWWQQQQWQWQWQQQWWmWBQWmQmmmoX2oooX####QWQQQQWmX2Svc+!3S
     |ii%1szXvdXmmQWQQQ#QWWQQQQQWQQQQQQQQWQWmWWQWW#W#m#mQmQ#QmQWWQQQWQm#Xv==:..:
      .I{vXXvnXX#$QWmW#WWBQWWWWQWQQQQQQQQQQQQWWWW#WWWmWmmQWWWWWWQQWWWmZZZzni|=:.
      =|<12XzoXX#mm#X#mYS###QQWWQQQQQQQQQQQWQQQmWQmQQWW#mQWBWWQQQQW$#mweXc"i= ..
     :;.:|InnnnXoXXW##XS1nX#XZ##QQQWQQWQQQQQQQmWQ$mm$WWZ#m#W$#QWW#Z#ZXS2i|--   <

src

              .  .. ... .                                    .                  
        .  ..NMDI=~:~?OMMI  ..  .                   . .  :NMMMMMN=. .   .       
     .  .M~.   ,MMDDMMMMD?.M=  ..                .   .M+ .,N? .~ ...~M..        
  ..  .M,.  NMNMOI$=  I.  I, :?~I               ..MMN..N7.M7$MMMMMMM . M.  .    
     M., MMMM... DMNI~?NMMNDMMM                   .M= . :ZMMMMM,.~~MMMM =M..    
  ..N..:MMNM7.8N,        .  ...                    ... .  .    .+D..MMM:. M.    
  .$. .MMM. == . .        ...                  ..... ...  .    ...:M,:MMM. M .  
..M  ,NMMN M:.            ..$M?....:ZM ..  . 78    ~M...         .. M.MMM ..N   
.: . MMMM ~. .           .D~.. . ,,    M.. IZ.. .. .. Z$          .  : MMM. $   
 M. .8MMM.Z. .        .. Z..IMMMMMMMMMM. MNM?N8MMMMMMZ..I          . N MMM,..I  
.N. MMMM.=.           ,M,.~MMMMMMMMMMMMM....7+ M~MMMMMMN..:  .      .=.7MMM .M  
 O.  8MM87.        . :Z..MNMMMMMMMMMMMMMM  . M  8MMMMNMMM  N       ..: MMM  .M  
 D..8MNM,?.      . ,O, 8MMMMMMMMMMMMMMMMM  . N .Z8MMMMMMMM .8.      .O DMMI  M  
.M...MMMM.M.       M, MMMMMMMMM?.:D87 ...M   . N: .,MMMMMMMI.~.      O,MMM. .M  
.M. ?MMMM..N  .. MD.:MMMM,  . ..  M       ZM= 7 .   8 .. DNMM  Z. . M  MM=. .D  
 : . MMMMMN  MMM .+MM8. ..  . $MMM7.    MM. . MM  MM M   ..NMMM  :...MMMMM  +   
 .M ..=MMMM   ..MMMM..       MO NM  .. .  ~  :? .MM.  O,    MMMMM ~MMMMMM~  M   
 .,=.7NNMMMMMM8MMMM  .      M?..$. D$ .M...=    .MM $ M.   ..NMMMMMMMMMM...M.   
   :?,.. MMMMMMMMM.       : ..      ,  ?...=     M..,8 .   .  MMMMMMMNM   M     
  . ~I  O MOMMMMM,           I,  .MMMMM,+...Z. ..MZMMMM.      OMMM?M 7.. M.,    
   ...O?..~.Z MM= .          =   .M. MM:   .. .   8MM.         OM ,... M ,      
       ,M+..   M            ,    . ,8NZD.$ ..     .NMM,. ..    .8M..$M, .       
        .  IMMN=            M .  . ..     .       ..I.M7  .     .~.  ....       
              8            MM .                   ...M.N+N.  .. ..N. .          
              M.          M::                     . . NM..~MD+     .M           
           . M .       .,M   I         . M$.   M , . ,.M,   ...  .  .           
            .M.       IM+.  .  .       .~=MMM  . Z8... . I..M   .   ..          
           MM  . IDMM+ N.                M..MMM.. . M .     =D..                
        .,M  ..MNM?   .MD        .MD:....:  MM.D~.          +M                  
         .M$..?  M~   .MN        ...=Z  .. . ....+          M                   
                 M.   .MM. .         .M,,      ..=    ... IM..                  
                 M.   .  M          .. M.      . .     IMN..                    
                 M=    . M,  ..         M  .          .. ~M...                  
                .MD    ..7NM.          .~O.          . .. .8                    
                .7M        MNM         .. MM.   ..ZMMMMMMM7  ,                  
                  M         M$         ... ..~$I...  . .M  ...                  
                 . M.       M?  .              ...      M..                     
                   ~$.       =$MM .. .    ...... .,=IZ+?M                       
                    ~$      ... ,M . I    ..=NMM$ZMN... .                       
                   . :I..       MM ZMZ. .,     . .M.                            
                    ..,M.      .NO NMMM..        ..M.                           
                      .. $..   .,MMMMMM...   .... .M.                           
                       .. I.   , . MM.MM,    . M NM..                           
                           ...    .:MI.MMM..8MMMM  ..                           
                         .  .    .M$...MMM MMMMMMN.                             
                                  :,. MNMMM,MMMMMMMM8=..                        
                                    . = +MMMMMMMMMMMM..                         
                                     .  . MM MM.IMMMN:                          
                                           ..  ...                              
                                           .                                    


~~~~===+?I7$D8DDNNNNDMN8Z7I?++=+==+==~~=~~:::::~:::~~~7ZONN8D888O888DDDDDDDDDDDD
~~~~==++?7$8DDNNNNMNMN8ZI7I??+==~:~~::,:::,,:,:,,::~~~+Z$O8NNDOZ8Z8O8DDDDDDDDDDD
~~~=?=I?+IZDNNNMMNMMMD8ZIIII+=~~:::,,,:::::,,,,,,:::==+ZZZDNN88O8D8O888DDDDDDDDD
~~~:=~?+7788NNMMMMMMNND$77II++==:~~~~~~====~~~:,:,,:~==$O8NNDDO888D888DDDDDDDDDD
~~~~===?7ODDDNNMMMN8MN8$III??+=~==+=++?++++??7$7Z7I+~~=+D$DMNN8D8DO8888DDDDDDDDD
~~~~=+?$$D8DMMMMMM8NNNZIII??7ZD878O7$II?IIII$ZZZOZ$$7=~~7N7ZODN8NOD8D88DDDDDDDDD
:~~===IIOD88NMMMM8NNN8IIII?7ZOO88O8ZZ$77I77$ZOZZO$?III=~~ZNOZ8DOODDDDD888DDDDDDD
~~=~=+7$8ODNMMMMDNMNM7??II$$77ONNO8O88OI+?Z888D8NNZO8??~~~N8$8O8DNDNDD88DDDDDDDD
:~~~+??Z88NNNNMMMNNNDI???777ODNNNNNDDDO+~?$OONODN7$77OI==~788ZO8D8NNDDDDDDDDDDDD
~~~~+I?ODDNNNNMMNNMNZ????I7O7$?8ZI$$$Z7~,:?ZOOZ$7???~:::~~?DND7Z888DDND8DDDDNDDD
:~~=I??ODDDDNNNMMNNN$I???IZIII$$$Z888??:,,:7Z$88OOO$?=::::?DNO88$8DNDDDD888DDDDD
:~+=+?7ONNNNMMMNMMMN7I??????7IOOOZ$++?==:,,~I?+=+~:.,,,:::~7D8OD8IDNDDDD8DDDDDDN
====??7DNNMMMMMDMMN8$II?????+++==~~~++==:,::~==:,,,,::,::::~ZM8O8ZD8DDNDDDDDDDDD
=~~=??8DDMMMMMMMMMMN7?????++=:~::==??+~:,,.,~I7I+=~~=~~:::~~?$NDDDM8DDDDD8DDDDNN
~~=??$8DNNMNNMMMZMND7I????++=++++?IZ=~~::::,:.,Z$7?I?++=~~~++ZZDDNMNDDNDDDDDDDDN
==++7Z8DNDMNNNMMMNNZ7I??I??????I$ZO$~+++?+?===+$Z8$77II?++==IZ7NMMNND8NDDDDDDDDN
~=+?7ODNNNMNNNMMO8ZO$7??????II7$O8O7O8N$7I$$D88I$O8Z777I???I7ZZNMMNNNDDDDD8DNNDN
=+=+$8DNNNDMNNDO88OOZ$7IIII7$$ZO887$Z8ND88NNDI7=O$D8O777I7$7Z7$NNDDNNDNDDDDDDNNN
~I+I$8DNDDNNN8DDD888OZ77777$$ZO8$?+7ZZOZONND$OI=?I88O$7777$OZ7ONMN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