jtaber wrote:
Who said tables are not amazing, check out this drawing done in html with tables and background color. Who needs CSS?
http://animenarutard.blogspot.com/2007/06/drawing-made-of-html.html

well, good for a little Sunday humor - found on digg, where else.

of course, there is SVG and Inkscape.

LOL! Gotta hand it to this person for creativity. Unfortunately, not for much else. I thought of doing this once, then the sheer inefficiency of doing a picture this way struck me, as I'll - pardon the pun - "illustrate" below. Most of us agree tables are for tabular data, and not layout. This goes to a far greater level of extremity - creating an image with something that was never designed to create an image. The most obvious, at least to me... Start with these simple premises:

* The drawing looks like about 256 colors, which means each pixel is one byte * Each character the person types is one byte in a properly written html file * A 250 x 250 pixel, 256 color image = 250 x 250 bytes = 62500 bytes = 61 kb

The image size above is about 61 kb, plus perhaps a little space for non-pixel formatting/meta data - not sure how that part works. To do the same using background colors in an html table with old-style, bad markup code, and assuming an ASCII character set:

<html>
<body bgcolor=000000>
<table border=0 cellpadding=0
cellspacing=1 bgcolor=ffffff>
<tr height=1>
<td width=2 bgcolor=######></td> (repeat this 250 times, manually enter an appropriate bgcolor value each time) </tr> (repeat previous 3 tags 250 times - including the 250 td tags repeated another 250 times - each time)
</table>
</body>
</html>

Correct me if I'm doing the math incorrectly, but Doctype declaration, <head> tags, <meta> tags, <title>, etc all set aside, consider that the presenter was using Windows, which uses 2 characters for every line return (new line + carriage return) we now have:

* 94 bytes on lines one through four
* 15 bytes on line 5, repeated 250 times: 15 * 250 = 3750 bytes
* 34 bytes on line 6, repeated 250 * 250 times: 34 * 250 * 250 = 2125000 bytes Note that the above bullet, considered by itself, is intuitively 34 times the size of the image file, all by itself...
* 7 bytes on line 7, repeated 250 times: 7 * 250 bytes = 1750 bytes
* 28 bytes on the remaining lines

Adding it together:  94 + 3750 + 2125000 + 1750 + 28 bytes = 2130622 bytes

We've turned a 61 kb raster image (pixel-based) file into a 2 mb bloated monster file.

Lard Ratio: A little over 34 to 1 - see third-to-last bullet above. For properly indented code, add 1 to the 34 for every white space character in front of each <td> tag...

Brandon Stout
http://mscis.org


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to