Flood Fill/Boundary Fill

I am looking for a flood-fill algorithm, which fills areas
with irregular boundaries in the Graphics2D object.
Are there any open-source library packages available
that can do that?

Also, it would be even better if the flood-fill algorithm
would support the following additional capabilies:
-Antialiased flood fill (such as e.g. in Photoshop)
-Filling an area with a given texture image instead of
just a color

I don’t exactly know what floodfill does, but

Can be archived even with plain Java2D (since java-1.2 there) and Graphics2D.setPaint(TexturePaint);

lg Clemens

[quote]Can be archived even with plain Java2D (since java-1.2 there) and Graphics2D.setPaint(TexturePaint);
[/quote]
That’s true! However, with Graphics2D I am only able
to fill predefined Shapes (e.g. polygon, rectangle,
circles and combinations thereof).

I am not able to fill an area until a predefined boundary.
E.g. a color which serves as boundary. Is there a library
out there that supports filling an area without a shape?
I think the fill technique is called “flood fill” but maybe
there is also another technical term for it?

Flood Fill is correct, its the process of starting at a point with a colour then moves out from the point filling in with a the colour until you reach a pixel with the boundary colour. Just like in a paint package.

I don’t know of any library buts it not a tricky thing to right a simple level.

Kev

Have a look at the traversing all pixels in an area thread. At the end there is a complete example that generates an image and then fills it. The algorithm is very fast, but don’t do antialiased or textured fills.

That’s great! Thanks!

Putting in a texture actually is pretty easy to do.