= $imagex) { $colours[] = $thiscol; continue; } if ($l < 0) { $colours[] = $thiscol; continue; } if ($l >= $imagey) { $colours[] = $thiscol; continue; } $colours[] = imagecolorat($image, $k, $l); } } foreach($colours as $colour) { $newr += ($colour >> 16) & 0xFF; $newg += ($colour >> 8) & 0xFF; $newb += $colour & 0xFF; } $numelements = count($colours); $newr /= $numelements; $newg /= $numelements; $newb /= $numelements; $newcol = imagecolorallocate($image, $newr, $newg, $newb); imagesetpixel($image, $x, $y, $newcol); } } } $image = imagecreatefromjpeg("UNICORN.JPG"); blur($image); header("Content-type: image/jpeg"); imagejpeg($image); //imagejpeg($image, ('Blur.jpg')); imagedestroy($image); ?>