= $width)) return; if (($y < 0) || ($y >= $height)) return; print_r(array_search(array($x,$y),$points)); $current = 0; //array search pixel if (!$current) { //raster.setPixel(fill, x, y); $area[] = array($x,$y); boundary_fill($x+1, $y, $width,$height, $points,$area); boundary_fill($x, $y+1, $width,$height, $points,$area); boundary_fill($x-1, $y, $width,$height, $points,$area); boundary_fill($x, $y-1, $width,$height, $points,$area); } } $im = imagecreatetruecolor(400, 400); $points = circle_midpoint(10,100,50); $color = imagecolorallocate($im, 255, 0, 0); foreach ($points as $pixel){ imagesetpixel($im,$pixel[0],$pixel[1],$color); } boundary_fill(10,100,400,400,$points,$area); foreach ($area as $pixel){ imagesetpixel($im,$pixel[0],$pixel[1],$color); } imagepng($im,'testing.png'); ?>