A bit ago, I came up with an interesting idea for representing images using HTML. I can see very little practical purpose for this concept, but some of you might find it useful. I’ve written a small C++ routine that converts a bitmap image into HTML code, and displays the image correctly. To see what this looks like, go to http://www.geocities.com/htmlgames/html_imaging_demo.html . Look at its source to see something very interesting. Right now, the translation results in very inefficient image encoding, about 25 bytes of html for 3 bytes of BMP format image. If you want to see the code, send me a private message & I’ll send you the code. I would love it if someone wants to make it more efficient (maybe with JPEG-style compression) and actually use it for something.
maybe its me, but I don’t see anything.
Using Mozilla Firebird. Tried in IE6, and it crashed.
Confirmation: Firebird doesn’t like this.
Mozilla 1.5 doesn’t either.
Try http://www.geocities.com/htmlgames/small_demo.html . It’s a smaller version of the same stuff. The other image is a massive amount of HTML (because of my program’s inefficiency), and it may have taken up enough memory to make the browser crash. Thanks for letting me know.
still not seeing anything (in IE6)
That’s really weird. You’re not seeing a little GIF-like graphic of the number 95? or a similar graphic about Flower Power? It works in IE 5.5. Does IE 6 crash?
oh. i have been seeing it then. thought those were part of the Geocities ads or something.
The reason it doesn’t show up in some browsers is that some browsers skip over rendering table datum (<td>…</td>) elements if they are empty. One common solution if you need an empty table cell that just takes up space and contains a colored background is to put a nonbraking space inside, like this:
By the way, with a program like this you might try implementing a GIF-style lossless compression scheme, whereby if you have several identical adjacent pixels you represent it as a single <td>…</td> with the width attribute greater than 1.
GIMP has been able to output to standards compliant all-browser compatable HTML with images for a long time now. What’s different about this?
Or perhaps you just didn’t know about it… you coulda just used their code (under appropriate license)… it’s an open-source project after all.
I would encourage anyone who feels the need to convert a format to HTML use GIMP. It’s not limited with the bmp->html either as anything it can open can be saved as HTML.