ASCII art gen

Every ASCII art generator I’ve found uses a saturation-based algorithm to render images.  Can anyone recommend a line-tracing based ASCII art generator?  The idea is that I have a black and white line art drawing (actually a pencil sketch) that I want rendered into an ASCII-art image.  Or someone could do it by hand – I don’t have the patience myself.

Here’s dustpuppy’s banner:

                   .`:;ij;f,;,
                .`;sk568G6itz,-",
              .\a\x68888888886r/,-'
            -._sV888P^98^"^9888k,-_"
           `.-\Q889"   "    `888/,-',
           .-_J88f           188KJ-_.
           ,-;388|    o o    |888[=-
           _".>88l           j88E:._"
            _"Z3886._ ,J.__.488R=;.
             .'/288888888888888S^._"
             '"j^7Z988888885R^L`-.
               ,'./jQV9TYVR\[\`".
                  '|'|! |'|`. "
                  ./ l  | \
                .'_ _.\ j, `._,.
               (_)_)._) (_.__,._)
 ____  _     ____ _____ ____  _     ____  ____ ___  _
/  _ \/ \ /\/ ___X__ __X  __\/ \ /\/  __\/  __\\  \//
| | \|| | |||    \ / \ |  \/|| | |||  \/||  \/| \  /
| |_/|| \_/|\___ | | | |  __/| \_/||  __/|  __/ / /
\____/\____/\____/ \_/ \_/   \____/\_/   \_/   /_/

That’s what I want (probably of a coffee bean and / or something from Minecraft) for Javacraft. Libcaca gives me beautiful images:

Minerva Mink as rendered by libcaca (img2txt -W 100 -d none)

Minerva Mink as rendered by libcaca (img2txt -W 100 -d none)

But I can’t use color in logon banners.  And I’m limited to 80 columns.  The same image with these constraints applied becomes this:

8888888888888888@@8X  @88888XX88888888888@88S%SSS%%%%%%ttttttttttttt;;;88888888
888888888888888888@8%  88888XX88888888888@@88%SSS%%%%%%tttt;ttttttttttt88888888
888888888888888888@8  @888@@@8888%XX88@8@XXS8SS%S%%%ttttttt;;ttttttt;;;8888888S
8888888888888888888S  %:8X88@@88X8t8  X S:.@8%S%S%%%ttttttt;;;tt;;;;;;;888SSSSS
8888888888888888888S% t:@8X@8X8:::::;;88;:8%X%S%%%%%%%%%%ttttt8888888888SSSSSSS
8888888888888888888S88@S88888t;::::::::8%X88%SS%%%%%%%%%%tt;;;88888888888SSSSSS
88888888888888888888@8@88@X8;;:..::::::;tS88%%S%%%%%%%%%ttt;;;88888888888888888
88888888888888888@8@88@@8@8;;:.::::::::;:8X:8%SS%%%%S%tt%88;;;88888888888888888
88888888888888888@X8@@@8Xt8S;:::.::::::.::;8.8SSXSS88%;:;8888888888888888888888
888888888888888888@@@@@S;;%8%:..:::::::.88888@X88%;;S8%%8:;88888888888888888888
8888888888888888888X88X:.:8%;t.::.......:;;8;;;8;8888888.t888888888888888888888
88888888888888888@8X8@;:::8:.:8;::....:..:::;;;;;;;;;%888;888888888888888888888
888888888888888X888@88:.;8tX ::8t:........::::::;;;;;%888@888888888888888888888
8888888888888X8@8XX88:;;88 X88@:;;::.::....:::::::::;%888888SSSSS88888888888888
88888888888888888XS8:t8S8;8@@88%X::88;:...:::::::::::%;8SX88888S888888888888888
88888888888888888X;;;:8.@ 8@888t8..:tS@%888S88888::;:8t8X8;88SSSSSS88888tt%%%%8
8888888888888@888;:::8SSS;: 8SSS@..:.S@S.t@888X88t;;8t8;88S88SSSSSS888ttt%%%SXX
8888888888S8@@S::.::::8t:.8@.X8%8.8@;t:%8%88XX88%t:88XS888888SSSSS888tt%%%SSX@@
888888888888X8.:::...:8...::t;;.:.:%XXS8;S8X8S8%%8  8S8S;;888888888tttt%SXX@888
88888888t88X8.......:;t..S@;;.......tt8S:XX:8;@8.S8888SSS8SSSSS88888t%%SX@88888
888888888@88........88...:S...     .;:8tt8%S:.;88;SX88888SSSSSS88888%%SX88888@@
888888t8@@X.........;%SS::.@@::..  .tt 8888:::SX8%8 8SS88SSSSS888888SSX88888@XX
88888S8@XX8......:8.S;X;8;::X8;.... .:t88:::XtX8;;;%@ S8;88888888888X@8888@XXSS
88888@@SSS.......%S  S.@S 8%::X@X888X@X:t8: 8St.:;;:;8%888888888%%SX@888888%%t%
8888@8SSSS:......% .8...:8:S8@ :8X@;@XX88SXXS8;;.::.:;8.8;888888SSX888888%t%%8%
888888SSSX:.....8@ .:.    ........:Xt.:t%SXSSS.t:::.:t8S88888888X@8888888tt %%%
8888888SSX:..:..8X.X...  ...........S8;; SSSXX S:...:8tS88888SSX8888XS%8tt:.:t%
88888X8XSXS..::;8% @.     ::::tX%;;:.:%tSXSSXS8Xt8:.tStXt88SSXS@888XSt;%;S;XSt%
888@8@8X@S@.:;8S%8 @......8; %@SSSSS %  8XXSS.888SSS%8X@8888@8888888%;; ;@ :%8S
88888@%8@%SS@8@888.@::;8.XS%SSSSS X.X88@SXXS888888888t%8X88S%8888S%%t@@@SSt:t8S
888888@88%S8t%%88 %;: SSSSSSXXS 8S888888XXX88888888@X@;S8X8t8 ;%t;t%tt:@ t t;%X
88888888X88S8tt%888X%SXXSSSSSS888888888XSS88@8888888888@8@8.@@@@8  :t::8.@@%%X8
888888888@S8t::.:t8XXXXXXSXS@S8888888@8XX@88@8@88@8888@888%..8X@X@8::%tt.S@%888
8888888888@8tt;::t8XXXXXSX:88888888888X@8S88@8888@888888888@8@8@@@@8 %X S8X8888
88888888888@88;..:%@XSX8X888888888@88X8888S8@8888@888888@@@888@8@@X@8:888X888@8
@@8888888888X8888888888888888@888888S@8888X8XX8@888@8888888@@88S@8X@@SS8X@88888
XX@@88888888888@X888888888X888@88888:888X888S8;S8888@@@8@888888;X@X8888X@888888
SXX@@@88888888888X8@@8@8@8888888@888888X88SS888t;8X88@@888888888@@X8888@8888888
SSSXXX@8888888888S8888888888@888@@88888S@SS8tt%%S@888%%X%88@8S8X88888@888888888
SSSSXXX@@8888888@S8888888888888@@888888@888 88%X88888t;%;8888888888888888888888
SSSSSSSXX@@88888@S8888888888@8@@@@@8@88888X888X888XS%tt;t@88888888@X8888888888@
SSSSSSSSSXX@@888@S8888888888@8888888S888888X8t888XSSt8%X8X@@@@X@8@S888888888@@@
SSSSSSSSSSXX@XXXS@8@8888888888888888@88X8888X888XSt;;;%8SS88SSSSSX88888888888@@

Which isn’t anywhere near good. Not that I’d want Minerva as Javacraft’s logon banner but regardless of what image I pick, the same restrictions apply. Can someone help me tune libcaca to generate decent logon banner material?

Advertisements

, , , , , ,

  1. #1 by Chadwick on December 2, 2010 - 4:16 PM

    Can’t say as I know much. I always wondered how they managed to get the cool ASCII images.

    • #2 by Joshua on December 2, 2010 - 4:28 PM

      The good ones are hand-drawn in a visual-block text editor. The cheating way is to use a saturation-based algorithm to select character shapes. There’re a bunch out there – this page goes over some of the most common and here‘s the source code for a very nice saturation-contrast algorithm with very nice fine line-art filtering and edge-finding.

    • #3 by Joshua on December 2, 2010 - 4:32 PM

      And I’m looking at how far caca-utils will take me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: