Home > PHP > Function > GD > imagefill()

imagefill()

imagefill - Flood fill

Syntax

bool imagefill (resource $image, int $x, int $y, int $color)

Arguments

  • image - An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().
  • x - x-coordinate of start point.
  • y - y-coordinate of start point.
  • color - The fill color. A color identifier created with imagecolorallocate().

Description

Performs a flood fill starting at the given coordinate (top left is 0, 0) with the given color in the image.

Version

PHP 4, 5

Return value

Returns TRUE on success or FALSE on failure.