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
0
votes
1 answer

FloodFill in Java

I am trying to implement a FloodFill version that makes recursive calls in the up/down direction, but uses iteration in the left/right direction. But, because of my lack of experience in graphics programming, it's been a pain to implement. Let me…
Luis Lavieri
  • 4,064
  • 6
  • 39
  • 69
0
votes
1 answer

Floodfill with "layers"

What I want is to create a vector drawing program with layers, but to avoid using transparency / opacity, I want to draw each shape from lowest layer to highest layer onto a single bitmap. For the filling, I want to floodfill the shape. My issue is…
jmasterx
  • 52,639
  • 96
  • 311
  • 557
0
votes
1 answer

Questions about the flood fill algorithm in Java

Doing homework, implementation of the algorithm flood fills. I'm writing a program to this guide: http://en.wikipedia.org/wiki/Flood_fill. And I have some questions: Is it normal to specify the parameters in function replaces the color of any…
rel1x
  • 2,351
  • 4
  • 34
  • 62
0
votes
1 answer

Error in Flood fill algorithm in Java

I have a problem with Flood fill algorithm, but I haven't got what is this error. I'm writing a program to this guide: http://en.wikipedia.org/wiki/Flood_fill and this is my error message: Exception in thread "main"…
rel1x
  • 2,351
  • 4
  • 34
  • 62
0
votes
1 answer

Fill function in basic graphics app in Qt

I have been creating a basic graphics program(like MS Paint) with simple GUI. I have two classes where one is a MainWindow which holds all buttons, sliders etc and a second class is a custom widget called drawingArea on which a user is able to draw.…
0
votes
1 answer

Filling objects with flood fill in java

here is my problem. I created a four-leaf clover and I want to fill him with colour. I have this simple seed_fill (flood_fill): package projekt; class SeedFill { private int width; private int height; private int[] canvas; public…
user3109034
  • 29
  • 1
  • 3
0
votes
2 answers

Python: floodfill algorithm for minesweeper

I'm writing a minesweeper game in python, and am currently trying to implement a floodfill algorithm. This is what I've written: def floodfill(CURRENT_BOARD, row, col): count = count_mines(row, col) if count in POSSIBLE_MINE_NUMBERS: …
JavascriptLoser
  • 1,853
  • 5
  • 34
  • 61
0
votes
0 answers

Detect and draw shape inside of available space between lines

My goal is to detect the different regions within a simple drawing constructed of various lines. Please click the following link to view a visual example of my goal for clarification. I am of course able to get the position of the drawn lines, but…
WalterB
  • 110
  • 2
  • 12
0
votes
1 answer

flood_fill algorithm in Matlab - works, but doesnt stop

Im developing a flood_fill algorithm in MATLAB right now, and I have a little problem that cost me a lot of time: function [ homoPoints ] = area2Points( matrix ) %AREA2POINTS makes an area of one's to only one one in the middle of the area % Input …
0
votes
1 answer

How to enumerate the cells of a Matrix using random flood filling?

Most of the flood-filling algorithms (animated) use an uniform expansion, for example: I implemented random walks in my code, but the problem is that it "forgets" some cells, like in the following picture: So, how I can flood fill a Matrix and…
Rosenthal
  • 149
  • 1
  • 2
  • 11
0
votes
1 answer

Pixel distance flood-fill

Problem statement: Input is a rectangular bitmap like this: 0001 0011 0110 The task is to find for each black (0) "pixel", the distance to the closest white (1) "pixel". So, the output to the above should be: 3 2 1 0 2 1 0 0 1 0 0 1 I have a…
mirgee
  • 390
  • 2
  • 13
0
votes
2 answers

Floodfill implementetion

I have a problem with my flood fill function: void floodfill(int x, int y,Pixel old, Pixel new){ Pixel current = getPixel(x,y); if(current.r == old.r && current.g == old.g && current.b == old.b){ setPixel(x,y,new); …
0
votes
3 answers

Floodfill in ActionScript 3

I'm trying to write my own floodfill function in ActionScript3, because the one provided by Adobe isn't flexible enough (you can only give one target color, I would like to give a range of target colours.) So, the terrible code I came up with so…
Jaaq
  • 611
  • 1
  • 5
  • 6
0
votes
1 answer

flood fill python, solving a maze

Returning an index out of range error, someone please help! def floodfill(maze, x, y, a, b): #maze[x][y] = b for i in range(1,len(maze)): for j in range(len(maze[i])): if maze[i-1][j] == a or [i][j-1] == a or maze[i-1][j]…
hey
  • 23
  • 4
0
votes
1 answer

Change FloodFill-Algorithm to get Voronoi Territory for two data points?

I got a grid with two points. I want to calculate the amount squares each point can reach before the other. Currently I implement a FloodFill-Algoritm, which can calculate the amount of squares one point can reach. How can I change that algorithm to…
Sven
  • 2,839
  • 7
  • 33
  • 53