Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet thread from alt.ascii-art, started 20 Feb 2002.
 _   _                     _        _             _     _           
| | | |___  ___ _ __   ___| |_     / \   _ __ ___| |__ (_)_   _____ 
| | | / __|/ _ \ '_ \ / _ \ __|   / _ \ | '__/ __| '_ \| \ \ / / _ \
| |_| \__ \  __/ | | |  __/ |_   / ___ \| | | (__| | | | |\ V /  __/
 \___/|___/\___|_| |_|\___|\__| /_/   \_\_|  \___|_| |_|_| \_/ \___|
images to ascii conversion algorithm ?

images to ascii conversion algorithm ?

alt.ascii-art · 13 messages · 20 Feb 2002 - 28 Feb 2002
Hello all,

I'm thinking of creating a little program that would convert greyscale
bmp's to ascii art. (I know i'm certainly not the first one to do
this, it's just for fun and learning)

The conversion from pixels to an ascii character troubles me the most.
I was thinking of grouping chunks of pixel data and then select a
character for that group but what particular character should that be?
What determines the choice for a character.

If anybody has some info that clears my head up a bit, it would be
appreciated very much.
(don't know if this off topic, if so, sorry)

Greetings,
Harm Cuppens

"Harm Cuppens" <s23...@mail.nwmissouri.edu> wrote in message
news:a38...@posting.google.com...
> Hello all,
>
> I'm thinking of creating a little program that would convert greyscale
> bmp's to ascii art. (I know i'm certainly not the first one to do
> this, it's just for fun and learning)
>
> The conversion from pixels to an ascii character troubles me the most.
> I was thinking of grouping chunks of pixel data and then select a
> character for that group but what particular character should that be?
> What determines the choice for a character.
>
> If anybody has some info that clears my head up a bit, it would be
> appreciated very much.
> (don't know if this off topic, if so, sorry)
>
> Greetings,
> Harm Cuppens

Have you tried the following:
http://groups.google.com/groups?hl=en&q=pixel+algorithm+conversion&btnG=Goog
le+Search&meta=group%3Dalt.ascii-art.*
?

I don't know if you will find what you are looking for, and I don't believe
I can offer any further assistance... But from what I've noticed, the
resident ascii-related programming guru (at least the most regularly vocal
one) is Markus Gebhart, maybe you can find something usefull at his site:
http://www.jave.de .

Good luck,
-Phydeaux

ObAscii:



(sig-sized ascii conversion of a snowball in antarctica flying in a
snowstorm)

Johannes 'Joey' R�ssel <Joh...@WeB.DE> ASCII art 23 Feb 2002 04:12 · permalink · report
> ObAscii:
>
>
>
> (sig-sized ascii conversion of a snowball in antarctica flying in a
> snowstorm)

Hey, that one's good. Which converter?

--
          (\_      |  news:de.alt.rec.ascii-art     _/)
        _." ';   __|   __,   ,_    __,      __,    .' "._
       /( )h\   /  |  /  |  /  |  /  |-----/  |     (/( )\
ctr___/  \|__   \_/|_/\_/|_/   |_/\_/|_/   \_/|_/   __|/  \__

"Johannes 'Joey' R�ssel" <Joh...@WeB.DE> wrote in message
news:a565pc$2v9$07$1...@news.t-online.com...
> > ObAscii:
> >
> >
> >
> > (sig-sized ascii conversion of a snowball in antarctica flying in a
> > snowstorm)
>
> Hey, that one's good. Which converter?

I'm creating an add-on to Kat's random ascii-art generator (see following:

>>obascii:
>>
>>      _  \ -  _  _
>>           _ . _
>>        _ -  \  .
>>          /  . _    - input characters
>>         . /
>>       ______
>>  _____\____/_____
>> /                \
>>| random ascii-art |
>>|     generator    |
>> \________________/
>>       /____\
>>       _____
>>      / . . \
>>     | -._.- |     - output ascii-art
>>      \_____/
>>
>>--
>>|  A___A                 _/_ /_ _  /  _ _/_  _   ,_  _
>>| ( @ @ ) (/(/ (/(/ (/(/.(  / /(-'/< (_\( . (_) /  `(_)
>>|  \_^_/      katATthekatDOTorg                    ._/

), tentatively titled "Kat's random ascii-art generator: The Addon".  It
will feature natural language processing (in both English and Esperanto), a
fractal-based pixel descrambler, and browser independant hard copy output
(with use of a printer, not included).  It's still in the pre-alpha testing
phase though, and budget cuts might force even more corner cuts.

Donations welcome! *hint, hint*

-Phydeaux

ObAscii:



(best viewed with white text on black background)
("Midnight power outage in the Carlsbad caverns")

Thanks for the help,

I managed to get some more insight on how to implement something on my
own, thanks for the link showing me i should use google more efficient
before going for the easy way out and asking ;-)

Thanks,
Greets,
Harm

"Phydeaux" <dwe...@kornet.com> wrote in message news:<a5793f$7gp$1...@news1.kornet.net>...
> "Johannes 'Joey' R�ssel" <Joh...@WeB.DE> wrote in message
> news:a565pc$2v9$07$1...@news.t-online.com...
> > > ObAscii:
> > >
> > >
> > >
> > > (sig-sized ascii conversion of a snowball in antarctica flying in a
> > > snowstorm)
> >
> > Hey, that one's good. Which converter?
> 
> I'm creating an add-on to Kat's random ascii-art generator (see following:
> 
> >>obascii:
> >>
> >>      _  \ -  _  _
> >>           _ . _
> >>        _ -  \  .
> >>          /  . _    - input characters
> >>         . /
> >>       ______
> >>  _____\____/_____
> >> /                \
> >>| random ascii-art |
> >>|     generator    |
> >> \________________/
> >>       /____\
> >>       _____
> >>      / . . \
> >>     | -._.- |     - output ascii-art
> >>      \_____/
> >>
> >>--
> >>|  A___A                 _/_ /_ _  /  _ _/_  _   ,_  _
> >>| ( @ @ ) (/(/ (/(/ (/(/.(  / /(-'/< (_\( . (_) /  `(_)
> >>|  \_^_/      katATthekatDOTorg                    ._/
> 
> ), tentatively titled "Kat's random ascii-art generator: The Addon".  It
> will feature natural language processing (in both English and Esperanto), a
> fractal-based pixel descrambler, and browser independant hard copy output
> (with use of a printer, not included).  It's still in the pre-alpha testing
> phase though, and budget cuts might force even more corner cuts.
> 
> Donations welcome! *hint, hint*
> 
> -Phydeaux
> 
> ObAscii:
> 
> 
> 
> (best viewed with white text on black background)
> ("Midnight power outage in the Carlsbad caverns")

Phydeaux <dwe...@kornet.com> ASCII art 25 Feb 2002 20:50 · permalink · report
"Harm Cuppens" wrote...
> Thanks for the help,
>
> I managed to get some more insight on how to implement something on my
> own, thanks for the link showing me i should use google more efficient
> before going for the easy way out and asking ;-)

Glad to be of service! :)

ObASCII:
    _ __ _
   ('/  \')
   (  `   )
  /        \
 (\(      )/)
.='\\ __ //'=.

Dave Bird <dav...@xemu.demon.co.uk> ASCII art 25 Feb 2002 21:33 · permalink · report
In article<a38...@posting.google.com>, Harm
Cuppens <s23...@mail.nwmissouri.edu> writes:
>Hello all,
>
>I'm thinking of creating a little program that would convert greyscale
>bmp's to ascii art. (I know i'm certainly not the first one to do
>this, it's just for fun and learning)
>
>The conversion from pixels to an ascii character troubles me the most.
>I was thinking of grouping chunks of pixel data and then select a
>character for that group but what particular character should that be?
>What determines the choice for a character.
>
>If anybody has some info that clears my head up a bit, it would be
>appreciated very much.
>(don't know if this off topic, if so, sorry)

 There are a number of ways you might do it.  Take the image 
 and make sure it is literally a collection of lines of pixels
 each presumably 32bits (10bits each R, G and B). For practical
 purposes it is best to reduce these to 8bits meaning R, G, B, 
 and Spare.  To get differentials (outlines) you might want to
 calculate the colour distance ,/'''R2+G2+B2 and record the
 popularity (occurrence) of each of the 255 values.  You might
 take >= the most popular occurrence at the high end as definitely
 being a line.  Collapse these into 1 bit, yes or no line present.
 You can have a table of how many bits correspond to each byte.
 Filter somehow, only keep bits where there is one 
 \|/
 - -
 /|\   from it too,
 like  (row[n-1]<<1)|(row[n-1])|(row[n-1])>>1 |
       (row[n  ]<<1)           |(row[n  ])>>1 |
       (row[n+1]<<1)|(row[n+1])|(row[n+1])>>1    ;

 You have an interesting problem whether you consider pixels 
 in a panel of fill on/off according to a certain level of
 colour only.  What you might do is cull them down according to
 the number on so, say, if it is dark then lots of pixels get
 to be on, but if it is pale then the threshold is low.
 Squeeze these also into 1 bit per pixel on or off.  Then you'd
 have to look what defines an ascii-character bitmap, maybe
 8 pixels wide by 10 high?  So you take cells of this form, 
 look to minimise  PicBits xor AhrBits across the cell trying
 each of the possible ascii characters.  

 In this way you might get something which takes accounts of edges
 and which fits character shape, as well as average darkness, to
 get something like a humanly produced conversion.


 For best results, why not combine it with human intervention.
 A "TV Screen" with buttons down the side to get GIF file,
 produce edges, (threshold up/down to improve fit), edit
 edge dots, and so forth.  
 

       _____          | | / /
      /     \       \         /
--  -| Duck! |     \__   ____  /
      \_____/     /   \ /    \  |  Dav...@xemu.demon.co.uk
  /| / You   \   /     |      \ \
 / |_\called?/__/     /        | |_____________/////////
<  |____\_______|     |        |(______________       ()
 \ |     \     /   () | ()     | |             \\\\\\\\\
  \|           |    __|__      | |     
              _|___/___  \___  | |     TWOING !!!
        __----         ----__\---\_
       /                        __ |        ______________________
       \____-------------______/  \        /                      \
                /    /  /      / _/     ---| hmm, it theemth       |
               /     \ /      / /          |   i thlighly          |
              /       $      / /           |   mithtook            |
             /              / /            |   your meaning there, |
            |              | /             |     buthtah  !!!      |
            \______________//               \______________________/
               \________/

 
 

Toni W Ruottu <twr...@cs.Helsinki.FI> ASCII art 26 Feb 2002 15:44 · permalink · report
I'm not sure if this helps you,
but why not make it understand color.

(R+G+B)/3 is the amount of color.
The colors with same amount of color are equaly dark/bright.

My friend did a Basic prog that converts 256c PCX:ses to Ascii Shades.
Why not to create a program that would draw and image in Ascii-lineart.


CyBeRiX -- a Finnish 19-year-old ASCII sucktion cup with furry hair.
                                      _._
   __   |  | |~\  |~~ |~\  o  | |   .#&}&[/    / Rock the Microwave.
 /    \ `\/` |-<  |-  |_/  |   \    + - /&?) /` Mono with freestyler.
|         |  |_/  |__ | |  |  | |   (_. &{&|
 \      /~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  `-   @@
   ~ ~ ~   http://CyBeRiX.cjb.net    `#_/'

ps. The things said by my ascii-figure are modifications from lyrics 
    of the Bom Funk MC's a Finnish country group. yiihaa.
    ((Very bad music honestly.))

Harry Mason <spa...@no.spam> ASCII art 26 Feb 2002 17:03 · permalink · report
On Tue, 26 Feb 2002 17:44:23 +0200, Toni W Ruottu <twr...@cs.Helsinki.FI>
wrote:
>  I'm not sure if this helps you,
>  but why not make it understand color.
>  
>  (R+G+B)/3 is the amount of color.
>  The colors with same amount of color are equaly dark/bright.

This isn't actually true, because the brightness you see is dependent on your
perception and the way your eyes respond to colour. There are different
colour spaces which more accurately represent percieved brightness, such as
Lab colour.

I don't suppose this will make much difference when converted to ascii-art
though.

ObAscii:

       /\       
      /  \      
     /,--.\     
    /< () >\    
   /  `--'  \   
  /          \  
 /   fnord?   \ 
/______________\

-- 
Harry Mason ("hjm200.ecs@soton@ac@uk" =~ tr/@./.@/)

Johannes 'Joey' R�ssel <Joh...@WeB.DE> ASCII art 27 Feb 2002 02:13 · permalink · report
> (R+G+B)/3 is the amount of color.

If you take into account the natural way of viewing pictures (as they are
interpreted by your brain), you have to double the green amount, so

(R+G+G+B)/4

> My friend did a Basic prog that converts 256c PCX:ses to Ascii Shades.

That's nothing special.

> Why not to create a program that would draw and image in Ascii-lineart.

That's way more diff�cult. Ask Markus Gebhard on his attempts to do this
with good results.

>     ((Very bad music honestly.))

Agreed ;)

Joey

--
          (\_      |  news:de.alt.rec.ascii-art     _/)
        _." ';   __|   __,   ,_    __,      __,    .' "._
       /( )h\   /  |  /  |  /  |  /  |-----/  |     (/( )\
ctr___/  \|__   \_/|_/\_/|_/   |_/\_/|_/   \_/|_/   __|/  \__

Toni W Ruottu <twr...@cs.Helsinki.FI> ASCII art 27 Feb 2002 12:12 · permalink · report
On Tue, 26 Feb 2002, Johannes 'Joey' R�ssel wrote:

> If you take into account the natural way of viewing pictures (as they are
> interpreted by your brain), you have to double the green amount, so
> 
> (R+G+G+B)/4
Thank you for sharing that information.
Just send an SMS-Message to my friend about it.

> > My friend did a Basic prog that converts 256c PCX:ses to Ascii Shades.
> That's nothing special.
I know. Just mentioned.

> > Why not to create a program that would draw and image in Ascii-lineart.
> That's way more diff�cult. Ask Markus Gebhard on his attempts to do this
> with good results.
In Jave or as a custom program?
If Jave so What part of it do you mean?
Watermark: Plasticbag technique maybe??
 

CyBeRiX -- a Finnish 19-year-old ASCII sucktion cup with furry hair.
                                      _._
   __   |  | |~\  |~~ |~\  o  | |   .#&}&[/    / I'm a * *
 /    \ `\/` |-<  |-  |_/  |   \    + - /&?) /`  slaa
|         |  |_/  |__ | |  |  | |   (_. &{&|          a
 \      /~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  `-   @@            aa
   ~ ~ ~   http://CyBeRiX.cjb.net    `#_/'               ave!
                                                 For you.

ps. Not to take it personally just singing Britney.
ps2. By the way look around in internet for a song called
     "Lets fuck Britney Spears" by Funk Styled Dynamic Design
      (It really does exist.) NERDHINT: TIS

"Johannes 'Joey' R�ssel" wrote:
> 
> Hi,
> 
> > > > Why not to create a program that would draw and image in
> Ascii-lineart.
> > > That's way more diff�cult. Ask Markus Gebhard on his attempts to do this
> > > with good results.
> > In Jave or as a custom program?
> > If Jave so What part of it do you mean?
> > Watermark: Plasticbag technique maybe??
> 
> http://groups.google.com/groups?start=125&hl=de&group=alt.ascii-art&selm=3C5
> 9AF2E.92AC8B89%40rz.uni-karlsruhe.de

That's right - this discussion was about new algorithms with edge
detection and edge tracing. You will also find some more information
about (more traditional?) algorithms when searching for keywords like
"image2ascii algorithm" and maybe "markus" - for I have posted a lot of
mails to alt.ascii-art about that subject.
One example thread can be found here:
http://groups.google.com/groups?q=markus+image2ascii+algorithm+group:alt.ascii-art.*+group:alt.ascii-art.*&hl=de&selm=3AE01CDE.85C9373B%40rz.uni-karlsruhe.de&rnum=4

Markus
(who unfortunately is very very busy and does not have time to finish
the 4.0 version of JavE - of course containing the new edge detection
algorithms...)
-- 
 \-/         http://www.jave.de    O_< Get JavE now!    \-/
J|a|v|E                           /|                   J|a|v|E
 /-\      Ascii-Art for eyeryone  / \   - for free!     /-\

Johannes 'Joey' R�ssel <Joh...@WeB.DE> ASCII art 28 Feb 2002 02:40 · permalink · report
Hi,

> > > Why not to create a program that would draw and image in
Ascii-lineart.
> > That's way more diff�cult. Ask Markus Gebhard on his attempts to do this
> > with good results.
> In Jave or as a custom program?
> If Jave so What part of it do you mean?
> Watermark: Plasticbag technique maybe??

http://groups.google.com/groups?start=125&hl=de&group=alt.ascii-art&selm=3C5
9AF2E.92AC8B89%40rz.uni-karlsruhe.de

Joey

--
          (\_      |  news:de.alt.rec.ascii-art     _/)
        _." ';   __|   __,   ,_    __,      __,    .' "._
       /( )h\   /  |  /  |  /  |  /  |-----/  |     (/( )\
ctr___/  \|__   \_/|_/\_/|_/   |_/\_/|_/   \_/|_/   __|/  \__

About this thread. These messages were posted publicly to the newsgroup alt.ascii-art in 2002 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post