paint-brush
Flood Fill Algorithm with Recursive Functionby@Ayve_178
5,799 reads
5,799 reads

Flood Fill Algorithm with Recursive Function

by Khairun Nessa Ayve6mJuly 14th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The “Bucket” tool of Microsoft Paint is used to fill an area with single specific color. We are going to discuss the algorithm behind the bucket tool. We will solve this problem using a Recursive Function. The idea is simple. At first we replace the color of current pixel and then we will go in 8 directions(N, S, W, E, NW, NE, SW, SE) and convert all the previous color values into the new color values. Then we will get the image with new color. The following is the implementation of the Flood Fill Algorithm.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Flood Fill Algorithm with Recursive Function
Khairun Nessa Ayve HackerNoon profile picture
Khairun Nessa Ayve

Khairun Nessa Ayve

@Ayve_178

I am a learner.

About @Ayve_178
LEARN MORE ABOUT @AYVE_178'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Khairun Nessa Ayve HackerNoon profile picture
Khairun Nessa Ayve@Ayve_178
I am a learner.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Coffee-web
Learnrepo