Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Flood fill
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==The algorithm parameters== [[Image:Recursive Flood Fill 8 (aka).gif|right|thumb|Recursive flood fill with 8 directions]] The traditional flood-fill algorithm takes three parameters: a start node, a target color, and a replacement color. The algorithm looks for all nodes in the array that are connected to the start node by a path of the target color and changes them to the replacement color. For a boundary-fill, in place of the target color, a border color would be supplied. In order to generalize the algorithm in the common way, the following descriptions will instead have two routines available.<ref name="85Fishkin" /> One called <code>Inside</code> which returns true for unfilled points that, by their color, would be inside the filled area, and one called <code>Set</code> which fills a pixel/node. Any node that has <code>Set</code> called on it must then no longer be <code>Inside</code>. Depending on whether we consider nodes touching at the corners connected or not, we have two variations: eight-way and four-way respectively.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)