Tuesday, 6 May 2008

An interesting gallery

So we've all seen ASCII art and probably played around with one of the online generators. A good one I found is http://www.text-image.com/convert which gives the results in HTML format so you can copy and paste the source. Wouldn't it be cool it have an image that as you rolled over every pixel it jumped out to give a preview of another image? I think so!

Although the outputted results are all in tags, a little find and replace will let you make them into divs, or 'a' tags which you can then style to give the effect you wish. This method means you needn't use the text to create your image, you can style your divs to mean the colour of the text is the background of a 1 pixel div.

for example:
my outputted result from text-image.com looks like this (but longer)

00
10101011101101001101110001110000001010011000111010001001000111111000101110011000101110110111101010110111111000

messy.

So let's find and replace ' '
replace '>1' with ' "> '

this just closes our style tag

then replace '
' with ''

wrap all those new divs in a '

No comments: