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 using an ArrayList not working

I'm wanting to use Floodfill to uncover neighbouring cells in a Minesweeper game. I'm new to Floodfill and perhaps I'm misunderstanding it. It never stops when it reaches a cell that isn't surrounded by a mine. Here is the code for the uncovering…
0
votes
1 answer

Graphical Editor Programming Challenges

I just can't find the error with this Graphical Editor program, from the Programming-Challenges book. Here is the link to the problem. All operations work and the test output works fine. Here is my code: #include #include…
Johan S
  • 3,531
  • 6
  • 35
  • 63
0
votes
1 answer

Making HTML5 canvas floodfill efficient

I'm creating a collaborative image drawing application using socket.io and canvas. By necessity, the canvas has to refresh fairly often, currently around every 50 milliseconds. I wanted to add a fill tool to the application, so I used my limited…
Jack Guy
  • 8,346
  • 8
  • 55
  • 86
0
votes
1 answer

Flood Fill Algorithm Resulting in Black Image

I'm constructing a flood fill algorithm that will hopefully, eventually, find a face in the center of a photograph based on the color at the exact center, and similar colors surrounding that. At the moment, however, my algorithm should take in any…
0
votes
1 answer

How to overcome "thin border" issue when using Flood Fill 4 algorithm?

I am writing an application that implements Flood Fill 4 algorithm. It works perfectly fine as long as the borders are thick. The algorithm fills in a certain color within the boarder. I tried to make the boarder thinner, but in that case the pixels…
Buras
  • 3,069
  • 28
  • 79
  • 126
0
votes
1 answer

Is this a Flood Fill program 8-way?

Hey this works correctly, but after comparing it to the 4-way i can't find any differences... If i were to hand this in would it be considered a correct method of implementing an 8-way flood algorithm? A yes/no answer will suffice, but i figured I'd…
Jube
  • 184
  • 2
  • 15
0
votes
1 answer

iOS FloodFill : UIImage vs Core Graphics

I'm considering building an app that would make heavy use of a flood fill / paint bucket feature. The images I'd be coloring are simply like coloring book pages; white background, black borders. I'm debating which is better to use UIImage (by…
hjin-sun
  • 3
  • 2
0
votes
2 answers

Floodfill memory leak iPhone

I'm implementing a floodfill function in C for the iPhone. The fill works, although I'm having 2 issues. The phone gives a memory warning after a few executions of the code below. Most likely a memory leak. Also note that the unsigned char *data…
Ospho
  • 2,756
  • 5
  • 26
  • 39
0
votes
1 answer

MS paint clone - how to store shapes

I've been trying to create an MS paint clone in javascript. Everything seemed perfect until I gave some thought about the fill bucket tool. I was using processing.js library and basically I was using the built in shapes (ellipse, rectangle and line)…
0
votes
2 answers

how to add mouseClicked to script

I have floodfill algorithm and I want add to this mouseClicked, but I dont know how becouse I have many errors. Here is my code. I want get the x,y possition from mouseClicked and give it to "floodFill(image,x,y, yellow);" Can anyone help me? thanks…
0
votes
2 answers

Recursive Flood Fill - Checking Boundries

I Have a recursive flood fill of legal neighbours in matrix ( legal neighbour is a neighbour with same color), the flood is not filling all the legal neighbours in the array. the board I`m using for testing is : int[][] map={{4,0,0,0}, …
MrAlmonds
  • 38
  • 1
  • 8
0
votes
2 answers

Identifying lakes in a bit mask in JavaScript

I have an algorithm that generates "continents" using simplex noise, so it'll generate a height map, and when a pixel/tile is above a certain level it'll be recognised as land, otherwise it's water. The problem I have is sometimes land will…
HedgepigMatt
  • 190
  • 3
  • 16
0
votes
2 answers

Most efficient way to draw individual pixels in OpenGL ES (Cocos2d-iphone)

I'm writing a flood-fill algorithm...it needs to paint individual pixels. What's the fastest way to do this? At first I thought of using cocos2d's drawpoint, but having 320 * 480 vertices doesn't sound too good. Is there a faster way using memset or…
user162400
  • 89
  • 2
  • 9
0
votes
1 answer

Efficient and practical flood fill algorithm in Java?

I need a flood fill algorithm for using with BufferedImage and Graphics2D in Java. I do not need the simple recursive (DFS) or queue (BFS) versions of this algorithm due to their impractically. I need an efficient, practical, and salable version of…
moorara
  • 3,897
  • 10
  • 47
  • 60
0
votes
1 answer

How to do custom drawing in on a image in objective-c

first of all i want to say that i'm newbie in objective-c. till know i have build an app that simply draws on one image (which is .png image that has 3 colors: red green blue). the applications draws lines in all over the image. what i want is to…
Florjon
  • 3,569
  • 3
  • 22
  • 29