imagefill

PHP 4, PHP 5, PHP 7, PHP 8
imagefill - Flood fill
Manual
Code Examples

imagefill( GdImage$image, int$x, int$y, int$color ): bool

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

Parameters

image

A GdImage object, 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.

Return Values

Returns true on success or false on failure.

Changelog

Version Description
8.0.0 image expects a GdImage instance now; previously, a resource was expected.

Related Functions

Example of imagefill

Show all examples for imagefill

PHP Version:


Function imagefill:

Image Processing and GD Functions

Most used PHP functions