Page 1 of 1
Fancy ASCII Graphics?
Posted: Fri Apr 25, 2003 2:26 am
by Kalle Kola
Hello all!
I have a question about rendering ASCII-Characters. I'm trying to use
the GD-lib to create png-files with ASCII-art and i wonder if it's possible
to render the fancy characters between 176 and 223 in the ASCII characterchart?
I'm using WindowsXP, Apache 1.3.27, PHP 4.3
Posted: Fri Apr 25, 2003 2:29 am
by []InTeR[]
[offtopic]
There was allready a kind of ascii art in php.
Was a jpg2txt. It just took a look at the color, and give the letter that collor. Not realy ascii-art but the effect was realy nice.
[/offtopic]
Posted: Fri Apr 25, 2003 3:56 am
by pootergeist
also off topic slightly
the .gd file format (old version of .gd2) uses single character per pixel data storage for low (under 257) colour images so you could just output a imagegd() call and then monospace the resultant file forcing line breaks at the line break characters (something like \Y or \Y!)
as to rendering ascii - if a loop doesn't render the set I doubt anything you did with GD would - might be your browser though.
<script type="text/javascript">
for (n=0; n<257; n++)
{
document.write('char number ' +n+ ' looks like &#' +n+ '<br />');
}
</script>
if that doesn't output the characters then blame your browser.
subnote: how are you currently reading the image? stepping through it a pixel at a time and using imagecolorat - imagecolorsforindex and the $v[0]+[1]+[2] / 3 ? - just wondered.
Posted: Fri Apr 25, 2003 4:01 am
by []InTeR[]
[offtopic]
I found the url of the script @
zend
see pref. post.
[/offtopic]
Posted: Fri Apr 25, 2003 10:32 am
by Kalle Kola
Thanks guys!