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
0 answers

my image not set in the center of relative layout and its not showing complete image using flood-fill and canvas

I want to set my bitmap converted image in relative layout with the help of custom view but my image not set in the center of relative layout and its not showing complete image My relative layout where I set my bitmap image`package…
Omer Arif
  • 31
  • 1
0
votes
0 answers

Paper JS Flood Fill Algorithm

Been trying to accomplish a paint like app to bucket fill any closed path, either it be two or more different items intersecting each other or a self intersecting one. What is currently working is filling an item which intersects the first mouse…
kamp
  • 375
  • 3
  • 13
0
votes
2 answers

Floodfill Algorithm working slow, how can i speed up this algorithm?

public void floodFill(Bitmap bitmap, Point point, int i, int j) { int k = bitmap.getWidth(); int l = bitmap.getHeight(); if (i != j) { LinkedList linkedlist = new LinkedList(); do { int i1 = point.x; …
N.R
  • 191
  • 1
  • 13
0
votes
1 answer

How to call camera image instead drawable

How can I call the camera image instead of drawable image? mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.image).copy(Bitmap.Config.ARGB_8888, true);
Nash
  • 1
  • 2
0
votes
2 answers

How to return new array out of Flood Fill in JS

I want to know how to change this algorithm to return new array of updated things instead of changing it in global map array. It's using JS implementation of Flood Fill algorithm. This is the array I have: var map = [ [0, 0, 0, 1, 1], [0, 0,…
Hp840
  • 21
  • 2
0
votes
1 answer

Floodfill algorithm C - return double array?

Given a double array of random values mod 5 and a value X and a position in the array, I have to change the position's value and all its neighbors to X. I'm doing it recursively. I think the idea is correct, however I must be messing with the return…
Tom
  • 23
  • 4
0
votes
1 answer

Flood Fill algorithm, works for a few seconds but then errors out. (pygame)

Trying to implement flood fill algorithm in pygame just as a learning experience. I have a good start I think and it is mostly functional, but after several seconds of working properly, it gives me a max recursion depth error. import pygame,…
0
votes
1 answer

Can't find the correct startvalue for FloodFill implementation in C++

I am trying to fill everything that is outside a contour using a queue implementation of flood fill. However i have some problems deducing the starting point to add to the queue. I define a new double of 400*400 named tmpSlice and fill it with…
0
votes
1 answer

QuickFill/flood fill algorithm

I need a flood fill algorithm to fill existing raster shapes with various colors and fill patterns. From what I know, the QuickFill algorithm is the best way to do a flood fill. I've found a number of implementations, but they are all in C++ and use…
Erick T
  • 7,009
  • 9
  • 50
  • 85
0
votes
1 answer

Can't spot the reason behind infinite loop

I am currently working on a program, that can read a set of coordinates from a file forming a contour and then fill it out using the flood fill algorithm. It seems that the code below runs in an infinite loop, but i can't seem to spot why. Help or…
0
votes
2 answers

Non-recursive flood filler method

I am making non-recursive flood fill method in Java which uses coordinates of clicked pixel (x,y) and color code as input. img is buffered image. Code works, but only for large simple shapes (like squares), and sometimes does not fill even…
0
votes
2 answers

Recursive algorithm or flood filling algorithm for raster?

I've got a binary raster like this: 101101 010111 101011 111101 Now I need to do this row by row: Go through row and count the adjacent cells which are 1 (only the cells in the row!). And I would like to get a vector or something like this. for…
Cocilein
  • 45
  • 5
0
votes
2 answers

Ruby Recursive flood-it

I'm trying to make a flood-fill that asks for user input starting from the top right corner of a randomly generated array filled with numbers 1-6 that are represented by 'colours'. I added the oldColor/newColor feature just now and I get error…
LeeKay220
  • 11
  • 1
0
votes
0 answers

Flood fill with gradient

I am trying to flood fill a UIImage with gradient. I already implemented this for solid colors. I tried to flood fill with UIColor colorWithPatternImage, but it's filling the image with weird colors. Could someone please point me to the right…
0
votes
1 answer

Java GUI Flood Fill Error

I have been playing around with Java GUI's and have run into a error which I cant figure out why. My program is based around flood filling (Filling color inside the lines) but when I try to fill I get this error: Exception in thread…
user5380876