Hello everyone,

Alright, what's wrong with this script?  I just get one big blank image.
I want the script to sequentially pull up each pixel off the template image,
and copy them pixel by pixel to the second image.

Actually, what I want to do is to process the pixels BEFORE I write them,
but this
is just a test to make sure I can write them.

I don't understand why it doesn't work.  But it has something to do with my
imagecolorallocate
function, I just know it.

Mr Lynch? Anyone? :-)

Thanks
Dan

============================================================================
=====================

<?

$template = "images/alpha-shadow.jpg";
$alpha = imagecreatefromjpeg($template);
$alphasize = getimagesize($template);
$alphawidth = $alphasize[0];
$alphaheight = $alphasize[1];

$x=0;
$y=0;
$im = imagecreate (500,500);
imagecolorallocate($im,255,255,255);

while ($y <= $alphaheight){

while ($x <= $alphawidth){

$alphacolor = imagecolorat($alpha, $x, $y);

$alphaindex = imagecolorsforindex($alpha, $alphacolor);


$red = $alphaindex["red"];
$green = $alphaindex["green"];
$blue = $alphaindex["blue"];

$pixel = ImageColorAllocate($im,$red,$green,$blue);

imagesetpixel($im, $x, $y, $pixel);

imagecolordeallocate($im,$pixel);

        if ($HTTP_GET_VARS["debug"] == 1){
        print("($x,$y) $red $green $blue <br>");
        }
++$x;

}

++$y;
$x=0;
}

if ($HTTP_GET_VARS["debug"] != 1){
Header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im);
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to