X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,db78abe5177a5c67 X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2001-04-20 04:26:28 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-karlsruhe.de!not-for-mail From: Markus Gebhard Newsgroups: alt.ascii-art Subject: Re: Gwyneth Paltrow - Jave image->ascii conversion .. and discussion of algorithms Date: Fri, 20 Apr 2001 13:26:22 +0200 Organization: University of Karlsruhe, Germany Lines: 152 Message-ID: <3AE01CDE.85C9373B@rz.uni-karlsruhe.de> References: <9bi18c$s21$1@news.inet.tele.dk> <3ADCB3E4.3404E133@rz.uni-karlsruhe.de> <987593119.12602@itz.pp.sci.fi> NNTP-Posting-Host: wn4-jarjar.wn4.uni-karlsruhe.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.rz.uni-karlsruhe.de 987765987 1728 172.20.12.141 X-Complaints-To: usenet@rz.uni-karlsruhe.de X-Mailer: Mozilla 4.77 [en] (Win98; U) X-Accept-Language: en Xref: supernews.google.com alt.ascii-art:5422 Ilmari Karonen wrote: > > In article <3ADCB3E4.3404E133@rz.uni-karlsruhe.de>, Markus Gebhard wrote: > > > >Now if you go further and divide characters into more than 4 regions > >(e.g.3x2) it all becomes even worse and the results when I tried to do > >that were not worth considering. > > Just as a data point, Rob Harley's classic bitmap-to-ascii algorithm > uses a 3x2 grid. The details can be found near the end of Jorn Barger's > technical ascii art FAQ, archived for example at > > http://www.sci.fi/~iltzu/ascii/ada/aaatechnical.txt This is a very interesting text. You are right, he uses a 3x2 grid, but he does not assign grey values to this grid - it is only 1 or 0, like that: L -> 10 / -> 01 ( -> 01 10 10 10 11 10 01 My 2x2-algorithm uses greyscales for the 4 areas - schematically: L -> 50 / -> 04 ( -> 33 88 40 33 (in the algorithm there are 256 values for brightness of each area) On Robs site, there is a conversion of mona lisa he did with the 3x2 grid: i`it)v|[[[[(//s+)`(-\\/JJgbdd@@@@@@@dmKK(c!(/-[2=/cct/!-v\!_L\)| ]-!/(!-)\L\)v|c5(!,!Ldd@@@@@@@@@@@@@@@@@@@dK/]!c\\\v|i\/cT\v((c- ]!`/v\//(-|t\VvcL!m@@@@@M@@@@@@@@@@@@@@@@@@@@bLt\\|)c/2-vv)/it\. --/-,\,\v\,|)/v/m@@@@@@K@@@@@@@@@@@@@@@@@@@@@@@bK!v!-( )-!.[/cT //.\--'--|-/c(e@@@@@@@DD@@@@@@@@@@@@@@@@@@@@@@@@@@s\\\\-||/v!c\. -,-|\`||\-\/id@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@b.),`-,-/c-`i !,\!-!-!'!-!d@@@@@@@P[+~**AAA@@@@@@@@@@@@@@@@@@@@@@@b/./`c-/.\7- --'.-- -/,id@@@*P!` \'Z8@@@@@@@@@@@@@@@@@@@@@i.\\'.\.c ',`,`\'-,-J@@5`- -- `-iYA@@@@@@@@@@b@@@@@@@@@_\-|-\c- '. -.,`/.G@@K- ` - )7KM@@@@@@@@@@@@@@@@@@@c-----/ - `- --i@@Ai -!ZZ@@@@@@@@@@@@@@@@@@@b! \`|-` `-,'- G@@@[, '.D8K@@@@@@@@@@@@@@@@@@@[/-,-/. -` .-/v@@@A) -)ZdMd@@@@@@@@@@@@@@@@@@\' _\ - ` ,iVJ@@@! '-!(K5K@@@@@@@@@@@@@@@@@@[(/s[. - i\G@@@Z- ' ! -i55ZZ@@@@@@@@@@@@@@@@@)(4)` , -|b@@@@!\ ' ` |-tYG@@@@@@@@@@@@@@@@XNYZ- tt@@@@A-, ' `)(d@@@@@@@@@@@@@@@@D)8A[ )8@@@@@\ ,-'-/Kd@@@@@@@@@@@@@@@@@KD@[ ]]Z@@@@d|- ,ii.c,, -.icLZKK@@@@@@8@K@@@@@@@@@(@8[ KN8@@@@@( .i!vG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@@@m -)!/stbb@b@@A@b@@@@@Kb@@@@@@@b@@@K@@@[ K@@d@@@@@d@M@8@@@@@Ks ,-/vJD@@8d@K@@@@@@8@@@@@@@@@@MK@@@b@@M@[ tN@b@@d@d@M@@@@@@@@@@LL4JKd@A@@d@@K@@@@MK@@@@8@@@@@@@@@@@b@@@@@[ )NM@8b@@A@@@A@@@@@@@@@@@@@@A@@A@@8@@K@d@@@@M@@K@@K@A@@@8@@M@@@@[ (tMM@@@d@@M8@@@@A@@@@A@@@A@@@@@@@@@A@@@@8b@@8d@@@@@@@@@@@@@@@@M[ tNZ@@K@@@d@@@@A@@@@@8@@@/4N@@8@b@@d@@M@8@MK@M8@K@@@@@@d@@@@@@@@[ M/KA8@@@MA@@@M@@@@@@@@@@[|t*Z@N@@@@8@@M8ZAZZ@M@@@A@d@@@@@K@@@d@[ bYJ4M@@@@@@A@@@@@@@@@@@@D.\'(YKKZD@8dK@5A84YZ@dM@@@@@@@@@@@@d@@[ K5dM8@8d@d@@@@@@@@8@@@@@@..-!/))ZK5AK4)AY(/XY/Z@@@A@@@d@@@M@@@@[ Y8dNA@@AK@@d@@@b@@@@@@@@@L,-,\!]]\X(5)Z/7c\\t5/K@@@@@@@@b@@@@@@[ 8M8@@@A@@@A@@8@@@@@@@@@KDLt! !,-|t'(-\\!,\/,\!ZJG@@@d@Md@@@G@@@[ robert@vlsi.cs.caltech.edu Here is about the same image converted with my 2x2 algorithm: >:-({(>=>(:(>=>(--(>(:(>((aaaaaaagaeeu(a--(((-(>(>-:-----------( ((:((>>((>=((({>--((aagggMMMBMMMBMMMMMMmmQQas:(((-((---(-----((( (:::(((((>:(>:::(agMMBBMMMMMMMMMMMMMMBMMMMMMMmQeo:-----(-------( -----------(--aggMMMMBMMMMMMMMMMMMMMMBMMMMMMMMMBMQe------------- -----------(agMMMMMMMBMMMMMMMMBMMMMMMMMMMMMMMMBBMMMmy-----```--- -------`-((gMMMMMBMMMMMMMMMMMMMMMMMMMMMMMMMMMMMBMMMMMme--.` .--- ----`----(gMMMMMMWF8V%=7VV99TWWMMMMMMMMMMMBMMMMMMMMMMMBQ--..--.- -``` ...(MMMM8v:----.`..`--((:(zO#MMMMMMMMMMMMBMMMMMMMBMma..---. ..--(MMBKx=>`` ``--(?OZ#MMMMMMMMMMMMMMMMMMMMMBy-.` . ..-aMMBK|--` .--(=zZX#MMMMMBMBMMMMMMMBMBMMMy-. `.aMMMB[(-` .--(c4ZS#MMMMMMMMMMMMMMMBMMBMmy-. -JMMBBD{--. .--(:{z0X#MMMMMMMMMMMMMMMMMMMMMm-.. _zwgBMB#{--- ` -` .--((>(=v0Z9HMMMMMMMMMMMMMMMMMMMMm(( _ngBMBMR0>---.. `` .`---((>==vv0UXSMBMBMMMMMMMBMMMBMBnx _2gMMMMBD=>---`-. -----------({z4dMBMMMMMMMMMMMMMBMMAx -4dMBMBBX=---..... .. ..---------(((uxwQdMMMBMMMMMBMMMMMMMMmO QQdMMMMMm{(-((((a----...(aagQQQwwwwsgwQQQQ#MMMBBMBMMMMMMMMMMBMEQ Q#MMMMMMmQggQU99#Aw----(gMMBMF8VU#MMMMBMMBMMMMMBMBBMMMMMMMMMMMM# ##BMMMMMMMMmQZmmmQZk--(4MMMHZ0VMMMMBMMMMW9VX#MMMMMMMMMMMMMMMBMBm dMMMMMMMD?98=-3T880z- (dM#D=-.-(VV9OZ0>---(4#MMMMMMMMMMMMMMMMMME dMMBMMMBr:::>>zZUv::--(4#X6=::>=?v0">:---(z4#MMMMMBMMMMMMMMBMMMB #MMMMMMB|-. ..```--``(zvvv--` ---((xdMMMMMMMMMMMBMMMMMMMB #dMMMMMBk----` --- (:==:--. ..--(zxg#MBMMMMMBMBMMMMMMMMMM BMMMMMMMm>--`. .--. -((>(----. ---((z4QdMMMBMMMMMMMMMMMMMMMMM MMBMMMMMBn----..-(-` ((cz[>----.----((wdddMMMBBMMMMMMMMMMMMMMMM MBMMMMMMMmo------(--._(agggk-------((zwQS##MMMMBMMMMMBMMMMMMBMMM MM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-:(->:(>(>=->:--(-(>?=4#MMMMMMMBMMMMM MMMMMMMMMMMMMMMMM@XX0=:-----(-->:-::-----------(>z4S#MMMMM##MMMM You have to decide for yourself which one looks better. Each of them has it's advantages and disadvantages (I don't like the lines (e.g. "----") in my conversion... > FWIW, I did once write an algorithm that used a 5x5 (IIRC) grid of > grayscale values, doing least-square-sum analysis to pick the best > match. It worked, in the sense that the output was recognizable, but it > was awfully slow and didn't look very good at all. Can you post an example? (The source image for mona lisa can be found at http://www.jave.de/image2ascii/competition2001/stage1.html ). > The major challenge in the field is IMHO developing a good non-local > asciification algorithm. The problem, which also comes up in a way in > in ascflip, is that any algorithm that handles each character separately > is bound to yield suboptimal results in some cases due to aliasing. I think the greatest problem are structures like "..." or "---". The human eye tries to connect them and makes lines appear in the image that where not there in the original one. Markus