Creating a image in Php pixel by pixel
Creating a image in Php from a image file pixel by pixel using this even you can compare from the the other images..
<?
header("Content-type: image/png");
$i1 = @imagecreatefromjpeg("tom1.jpg");
$diffi = imagecreatetruecolor(640, 480);
for ($x = 0; $x < 400; $x++)
{
for ($y = 0; $y < 400; $y++)
{
//getting colors at particular pixel point
$rgb1 = imagecolorat($i1, $x, $y);
//Splitting the colors into 3 variables r,g,b
$r = ($rgb1 >> 16) & 0xFF;
$g = ($rgb1 >>
& 0xFF;
$b = $rgb1 & 0xFF;
//allocating colors on the image
//Creating color identifier..
$green = imagecolorallocate($diffi, $r, $g, $b);
//setting the pixel on the image $diffi by the color identifier $green
imagesetpixel($diffi, $x, $y, $green);
}
}
//Creating the image
imagejpeg($diffi);
?>