GD Library Helpers

Being able to fill spaces with color or COLOR_TILED is essential to being able to produce good images. Imagefill is the same as Floodfill at ImageMagickô. And just like at IM you may need to fill several areas.

Keep the Grid script in your page at all times while making an image. Put it before the output and use /*at the beginning and */ at the end to comment it out, and removing them when you want to use it....and always keep the // before the GRID word...

By putting the grid over your work, you can count the number of pixels to the right and down to use to fill each section. The grid in this case is set for 20 pixel squares but that can be changed in the script.

Grid Example

As you can see, there are five more sections that need fill commands. Count the 20pixel squares across till you come to a white space inside the rectangle. Count the same way down. Those are you fill coordinates. It can be anywhere INSIDE a white space and it will fill that entire space.
See if you can fill each space with a different color using the grid to extablish your coordinates. Here is a text file of the image above.
GD BasicsHome