snippet library logo
Amazon.com
in category
PHP / Image Manipulation / image2text
Snippet details
ID: 526
Viewed: 1504
Added: 2004-06-12
Version: unknown
Sorry no demo

User Rated at:
Rate This:
Snippets in this catagory         
Show Printable Version
This is just a fun snippet that will turn a picture into text (even colored text).

General Details
Snippet uploaded by: Aaron Campbell
Email : snippetlibrary@ezdispatch.com
Snippet By: Aaron Campbell

<!---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_src0000$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 
"<br />";
}
?>




No Reviews to show


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


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.