Questions tagged [flood-fill]

Flood fill is an algorithm to determine node adjacency in graphics or multidimensional data sets.

Flood Fill (sometimes known as Seed Fill) is an algorithm to determine node adjacency in graphics or multidimensional data sets, commonly used for "paint bucket"-style operations.

See also

475 questions
6
votes
3 answers

Algorithm to create hex flood puzzle

I'm creating a puzzle game that, while playable by hand for easy levels, is meant to be solved by computer programs for harder ones. The puzzle is a flood fill on a hexagonal board. You can try a prototype here. (source: hacker.org) Here is how…
adum
  • 2,890
  • 3
  • 25
  • 30
5
votes
2 answers

Iterative queue-based flood fill algorithm 'expandToNeighborsWithMap()' function is unusually slow

I am creating a pixel art editor for Android, and as for all pixel art editors, a paint bucket (fill tool) is a must need. To do this, I did some research on flood fill algorithms online. I stumbled across the following video which explained how to…
thebluepandabear
  • 263
  • 2
  • 7
  • 29
5
votes
4 answers

Different Methods of Performing FloodFill

OK everyone I have several different methods of performing a FloodFill. All of them cause problems. I will list the 3 methods and explain what happens with each one. If anyone could give me some pointers that would be great. I have seen some…
Satanfx55
  • 93
  • 3
  • 7
5
votes
2 answers

Flood filling of 3-dimensional polygon

here is a problem for you ;) I have a 3-dimensional array filled with 1s and 0s. The 1s represent 3 dimensional complex polygons ( not simple polygons ). Only the boundaries of the polygons have the value 1, the inside is filled with 0s. Now here is…
stef
  • 69
  • 3
5
votes
3 answers

FloodFill in iPhone

I'm very new to iPhone development. I want to create a application using FloodFill algorithm in iPhone. I'm have no idea about FloodFill. Please Explain me the purpose of FloodFill algorithm.If you give a sample application for…
kanmani
  • 671
  • 1
  • 10
  • 28
5
votes
1 answer

OpenCV: Using a loop to find white pixels and flood fill them

I have the follow image: I'm trying to create a loop that will take into account the colour of each pixel, and flood fill from any white points it finds. At the moment, I have this code: for(int y=0; y
Luke4792
  • 455
  • 5
  • 19
5
votes
1 answer

Floodfill part of an Image

I have an image like bellow i want to make the image become like I already make the code, like this : var Tx,Ty, R,G,B,A, posX, posY : integer; begin posX :=-1; posY := -1; for Ty:= 0 to Image1.Height-1 do begin for Tx:= 0 to…
Then Theresia
  • 167
  • 1
  • 11
5
votes
3 answers

Flood Fill in Python

I'm complitely new to Flood Fill algorithm. I checked it out from Wikipedia (http://en.wikipedia.org/wiki/Flood_fill). But didn't become that much wiser. I'm trying to use it in following situation. I have a matrix: matrix = [["a", "a", "b", "a",…
Waldema
  • 121
  • 1
  • 2
  • 7
5
votes
2 answers

Flood fill algorithm selecting pixels with a minimum number of neighbors

I'm working on a plate tectonics simulator that uses a repurposed flood fill algorithm in order to detect continents. The algorithm is much the same. The only difference is that it works with vertices instead of pixels. I've been trying to improve…
16807
  • 1,418
  • 2
  • 18
  • 32
5
votes
3 answers

What do you call an iterated flood fill algorithm?

I have an algorithm that I'm using for my work, but I need a name for it. I am curious if name exists in the literature for an algorithm of this type. The algorithm takes a pixelated height map and a starting point s, and returns a modified…
John
  • 5,735
  • 3
  • 46
  • 62
5
votes
2 answers

Pathfinding algorithm for trains

I'm trying to find a solution for pathfinding in a trains game where there are different kinds of bifurcations. I want the train to go from one rail to another, everything is implemented except the pathfinding. I need to get a list of rails so the…
marcg11
  • 720
  • 2
  • 10
  • 20
5
votes
2 answers

Flood Fill Optimization: Attempting to Using a Queue

I am trying to create a filling method which takes the initial coordinate specified by the user, checks the character and then changes it as desired. After doing so, it then checks adjacent squares and repeats the process. After some research, I…
osama
  • 622
  • 2
  • 10
  • 19
4
votes
2 answers

Efficient 8-Connected Flood Fill

I've been using Paul Heckbert's excellent seed fill algorithm (available here and in the book Graphic Gems (1990)). Convoluted as the algorithm may appear. It's well-conceived and it's fast! Unfortunately, it's only for 4-connected spaces. I am…
Richard
  • 56,349
  • 34
  • 180
  • 251
4
votes
1 answer

Canvas - floodfill leaves white pixels at edges for PNG images with transparent

Now, I tried to perform flood fill algorithm to fill up the transparent PNG images using flood fill algorithm from the article How can I avoid exceeding the max call stack size during a flood fill algorithm? which use non recursive method along with…
4
votes
2 answers

finding largest region with small difference more efficiently

There is an grid consisting of h * w (h, w <= 200) pixels, every pixel is represented by a value, we want to find the largest continuous region. A continuous region is defined in this way: Given a point P(x, y), The connected region must include…
TYeung
  • 2,579
  • 2
  • 15
  • 30
1 2
3
31 32