Not a Member Yet,
Click here to Register

ID: 526
Viewed: 3913
Added: Jun 11, 2004
Version: unknown
Snippet uploaded by: Aaron Campbell
Written By: Aaron Campbell
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

This is just a fun snippet that will turn a picture into text (even colored text).

<!---Head--->
none

<!---Body--->


 <?php
if($_GET['image']){$image = $_GET['image'];}else{echo "No Image Specified!"; exit;}
if($_GET['letter']){$letter = $_GET['letter'];}else {$letter = "#";}
//$image = "jhn.jpg";
$dim = getimagesize($image);
$im_src = imagecreatefromjpeg($image);
$width = 30;
$height = $dim[1]*$width/$dim[0];
$im = imagecreate($width, $height);

imagecopyresampled($im, $im_src, 0, 0, 0, 0, $width, $height, $dim[0], $dim[1]);

for ($x = 0; $x < $height; $x++)
{
for ($y = 0; $y < $width; $y++)
{
$color = imagecolorat($im, $y, $x);
$color = imagecolorsforindex($im, $color);
echo "<b style="color:rgb(". $color['red'] .",". $color['green'] .",". $color['blue'] .")">". $letter ."</b>";
}
echo "
";
}
?>


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!