Making Images from HTML tables

Status
Not open for further replies.

remrow

This.. Is.. Sparta..!!
Making images from HTML tables. Did you got it ?
If you haven't then it is like using no images but using clean HTML tables to make an image.

So I turned out to a pretty looking picture from Yahoo Answers Avatar, an avatar of someone that was 48 X 48 resolutions. You guys might be thinking it is too easy; NAH! Think again. It is 2304 cells, which will still wrinkle your fore head and open your mouth.

Here is how i did it.
*likeweb.blogspot.com/2008/04/making-image-from-html-table.html

you guys are welcome to show your works too. :lol:
 
OP
remrow

remrow

This.. Is.. Sparta..!!
Do you mean to slice images and arrage them??
That is being used in many places nowdays , just their size is big. So making an image from the HTML tables is unusual thing to do.
 
OP
remrow

remrow

This.. Is.. Sparta..!!
Well the making of image i did on the post is now an old thing to do. I found out this code that does it all so fast and cheap timing.
It is a php code guys.

Code:
<?php
$image = 'picture.[B]png[/B]';
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "*www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="*www.w3.org/1999/xhtml"><head><meta http-equiv="Content-type" content="text/html;charset=utf-8" /><title>Rendering "', $image, '"</title><style type="text/css">table, table * {margin:0;padding:0;border:none;font-size:1px;} td {width:1px;height:1px;}</style></head><body><p>Rendering image at "', $image, '".</p><table cellpadding="0" cellspacing="0" border="0" height="480" width="480">';
ob_flush();
$size = getimagesize($image);
$im = imagecreatefrom[B]png[/B]($image);
for ($y=0,$ySize=$size[1]; $y<$ySize; $y++) {
    echo '<tr>';
    for ($x=0,$xSize=$size[0]; $x<$xSize; $x++) {
        $rgb = imagecolorsforindex($im, imagecolorat($im, $x, $y));
        $color = "rgb({$rgb['red']},{$rgb['green']},{$rgb['blue']})";
        echo '<td style="background-color:', $color ,';color:', $color,';" height="10" width="10"></td>';
    }
    echo '</tr>';
    ob_flush();
}
imagedestroy($im);
echo '</table></body></html>';
?>
Change through the bolded part to work with other jpg or gif images.
 
Status
Not open for further replies.
Top Bottom