Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 11 Feb 1999.
Re: GIF / BMP / TIF etc. => ASCII

Re: GIF / BMP / TIF etc. => ASCII

Marcel Gleis schrieb in Nachricht <918...@emil.nef.wh.uni-dortmund.de>...
>hi,
>does anyone know where i can find a "picture => ascii" converter??? i found
>some pics in the net which can't be handmade !!!
>
>
>
>if you don't know this? what algorithm do i have to use???
>
>thanx,
>marcel
>
>



There are a lot of programs to do this:
GIFscii, ASCgif, BMP2TXT, ...

I think you will found most of them here:
ftp://ftp.wwa.com/pub/Scarecrow/Software/
gopher://twinbrook.cis.uab.edu/1A/atools.70


----

I know no program which supports GIF,BMP & TIF together. In my opinion it isn't important
what kind of input format is used. All pictures must me converted to gray scale with
maximal 94 colors because ASCII art can only simulate gray shades by using different
characters. The main conversion from pixels to characters has no real algorithm. The
reason is that the char's aren't sorted by their 'darkness'. I think most of the programs
use therefore a intern character pattern.
Alternative it might be possible to let the prog. sort them by checking the black shade of
each character (counted black pixels depending from the current font). Nevertheless I
don't believe that this is a good idea, because it costs some time and the result will not
be better. The main problem is that there is no algorithm which can calculate a "best
viewed with human eyes" character. You could reduce the used characters because many of
them didn't have enough contrast (W-M, Q-G, 1-I, ...), but this will only help a bit. In
my opinion you must always replace some characters manually to become a really good
result.

If it isn't important for you that the color to character conversion considers the
darkness you can use a simple algorithm like this one:
(should use a gray scaled picture, colors mustn't be indexed)

] CONST
] maxRGBcolor : Integer           (Normally white, RGB=16777215)
] step        : maxRGBcolor/94, Extend
]
] VAR
] Pixcolor    : Current RGB value, Integer
]              (Example Pixcolor:=colortoRGB(pixel[x,y])
] Char1       : Current Character, char
]
]
] Char1 := chr(126-round(Pixcolor/step)))    //126 = last ASCII char.


[This is NO program source, you need to translate it in your programming language ;)]

You can make a function of this and convert the pixel colors to a character. A simple way
to make this function better is to convert all RGB values less than ~3000 to '#' (more
than ~16770400 to SPACE).
Although this is a very easy way to handle the conversion you become much better results
with an intern pattern. You sort the characters by the 'darkness' and put them in a array.
Then you can read then for example in this way.

] pattern: Array[1..94] of char      ('#','W','X' .... '~','.',' ')
]
] Char1 := Pattern[round(Pixcolor/step))]

Ok. I think that's enough.

Bye Marc

PS. University of Dortmund, Germany... :-)


               O=============================================O
  ,,,,,,,,     I  __  __   ___   ___   _  _           _,,,_  I
.,,,  __  \_   I |M \/ M| |E__| |P_ \ | || | ASCII   / o o \ I
(    ( o)   \_ I | |\/| | | _|  |  _/ | HH | & more  >  P  < I
`\           o)I |_|  |_| |E__| |_P   |_||_| ~~~~~~  \_\_/_/ I
  \     \____/ I                                             I
   \   ____/   I  ASCII-, ANSI-, HTML-art, programs, ...     I
    )  )       O=============================================O
\__/    \  Index page:
     \\_ ) http://studenten.freepage.de/meph/ascii/ascii.htm
\___ __ /  English "fast-link" page:
  _//  \\_ http://studenten.freepage.de/meph/ascii/eng/eng.htm

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,6e20a56eb8275081
X-Google-Attributes: gidf996b,public
From: "Meph" <UZS...@ibm.rhrz.uni-bonn.de>
Subject: Re: GIF / BMP / TIF etc. => ASCII
Date: 1999/02/11
Message-ID: <79vca4$13e...@news.rhrz.uni-bonn.de>#1/1
X-Deja-AN: 443326517
References: <918...@emil.nef.wh.uni-dortmund.de>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
Organization: BTS
Newsgroups: alt.ascii-art
About this message. This message was posted publicly to the newsgroup alt.ascii-art in 1999 and is 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 the author? 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