This is how Paint's bucket fill works (Flood fill algorithm)

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 72

  • @insidecode
    @insidecode  ปีที่แล้ว +2

    Discover the new graph theory algorithms course: inscod.com/graphalgo
    🔴
    / \
    🔵-🔴
    | |
    🔴-🔵

  • @szilardbenyovszky5075
    @szilardbenyovszky5075 11 หลายเดือนก่อน +5

    Man you deserve more recognition. I went from hopless to implementing flood fill into my command like paint project in 9 minutes. Thanks :)

  • @alexromero3274
    @alexromero3274 3 ปีที่แล้ว +31

    I'm a visual learner and your videos are SO helpful! I appreciate it! Thank you :-)

    • @insidecode
      @insidecode  3 ปีที่แล้ว

      You're welcome!

    • @nishaindesilva3738
      @nishaindesilva3738 2 ปีที่แล้ว +1

      yup me too....videos are very self-explanatory compared to long scrolling websites

  • @TABandiTA
    @TABandiTA 3 หลายเดือนก่อน +3

    Thanks a lot. We need more non-indian math/coding youtubers.

  • @csaki01
    @csaki01 ปีที่แล้ว +2

    Thank you! This was exactly the 8 minute video I needed to learn about flood fill algorithms for today's job.

  • @richardpro8927
    @richardpro8927 22 วันที่ผ่านมา

    Awesome ❤ amazing visualisation loved it and moreover understand the dreaded BFS/DFS
    THANKS A TON

  • @hangkikuta6786
    @hangkikuta6786 2 ปีที่แล้ว +1

    This is a GOD SEND to me to prepare for my exam. Thank you!

  • @will-gama
    @will-gama หลายเดือนก่อน

    Fantastic explanation, well done

  • @nishaindesilva3738
    @nishaindesilva3738 2 ปีที่แล้ว +2

    I thank you a lot, the second recommended method works well in my android app. Compared to other method, this technique has no nested loop and less overload. Bravos !

    • @insidecode
      @insidecode  2 ปีที่แล้ว

      You're welcome!

    • @cicik57
      @cicik57 2 ปีที่แล้ว

      @@insidecode you can improve the algorithm by drawing not by point by point, but entire line - until it hits borders and then go to the next line what is near. Maybe you will make do tutorial about that.

  • @manpt123
    @manpt123 ปีที่แล้ว +2

    Sir thank you so much for making the algorithms easy and visuable for us.

  • @rahulkaushal2985
    @rahulkaushal2985 3 ปีที่แล้ว +6

    Best explanation of the problem thanks sir for clear my doubts 🤩🤩

    • @insidecode
      @insidecode  3 ปีที่แล้ว +1

      You're welcome!

  • @tanvirahmed3715
    @tanvirahmed3715 3 ปีที่แล้ว +2

    Wonderful explanation, flood fill was blurred to me until now. Thanks

  • @Samimies
    @Samimies ปีที่แล้ว

    Thanks a lot! I was wondering why my floodfill wasn't working like it should. It turned out that it was because the logic was DFS no BFS.

  • @florinmatei8846
    @florinmatei8846 2 ปีที่แล้ว +3

    If we would use a sorted stack (function of Manhattan Distance from current pixel to the seed one) we might find it useful for maintaining the "shape factor" of current filled zone which is meant for using less working memory data. Also, there could be some "memory data write protection" for the same purpose. These as some start point for further algo features to be added.

    • @florinmatei8846
      @florinmatei8846 2 ปีที่แล้ว

      If the memory data used for the sorted stack kinda needs circulary overwrite, then we might use , first, some data sampling, probabily the shape factor will work pretty well in this case , either

    • @insidecode
      @insidecode  2 ปีที่แล้ว +1

      Interesting remarks

    • @florinmatei8846
      @florinmatei8846 2 ปีที่แล้ว

      @@insidecode Thank You very much! You are very kind.

  • @anhduc0913
    @anhduc0913 3 หลายเดือนก่อน

    How did you make videos like this? This is very informative and is great for visualising algorithms while also explaining the coding for it.

  • @Antagon666
    @Antagon666 2 หลายเดือนก่อน +1

    Shouldn't you start with right cell search to optimize memory access though ?

  • @iwormix6844
    @iwormix6844 2 ปีที่แล้ว +1

    Hmm, recently i have implemented this algorithm to find the differences between two pictures, and visualize them, I didn't even know, that it has "Flood fill" name :)

  • @SimpleLivingHigherThinking
    @SimpleLivingHigherThinking 8 หลายเดือนก่อน

    Cool way of learning computer graphics I was finding it boring to read from other channels

  • @sushismitcher225
    @sushismitcher225 ปีที่แล้ว

    the indentation on your github page is broken. Good helpful tutorial!

  • @prashanthpremakumar6637
    @prashanthpremakumar6637 3 ปีที่แล้ว +5

    this was really great!!!!

  • @pingpong-kv6eq
    @pingpong-kv6eq 5 หลายเดือนก่อน

    Thanks you man that was really well shown

  • @jenniferfan8155
    @jenniferfan8155 6 หลายเดือนก่อน

    Best explanation ever!

  • @소금냠냠
    @소금냠냠 3 ปีที่แล้ว

    It’s so wonderful. Thank your uploading!

  • @SoraFromIndia
    @SoraFromIndia 3 ปีที่แล้ว +1

    Hey, yes you have improved a lot from before. Now I can pinpoint the only issue you have cuz you are overall so much more clear in your speech now. It's the way you pronounce words with the alphabet 'O'. Okay lemme try, see when we pronounce a word that has an 'O' in it, like the word - 'word' itself => our lower lip only moves (kinda) but when you are speaking this word, you put too much pressure where the alphabet 'O' is. (Try not to change your intonation too much and maybe just here and there but just a little so that it doesn't sound robotic. I had issues in speaking in monotone and had to learn it the hard way lol)
    This is just an example for this word. It's not a rule that every word with an 'O' will only use the lower lip. But it makes it a lot clear when we don't put too much pressure in any specific alphabet. Different languages pronounce the English language in a different way due to which we have so many accents. But a common thing in all the accents that are easy to understand => they don't apply pressure to specific alphabets.
    Once again, just trying to help if all this explanation makes sense. Your knowledge and way of teaching is excellent. All the best mate!
    Edit - Oh and this one was the best video by far. I had doubts in this one too but it's all clear now. Thanks!

    • @insidecode
      @insidecode  3 ปีที่แล้ว

      Thanks for this detailed feedback! Sure it's gonna help me improve

  • @afadeevz
    @afadeevz ปีที่แล้ว

    Space complexity for BFS is O(n + m)

  • @Lycam
    @Lycam 2 ปีที่แล้ว +2

    Dont use recursion, instead use a Stack or a Queue with a loop.
    With recursion you let the program use its own stack and it has a small limit.

    • @rutabega306
      @rutabega306 ปีที่แล้ว

      Not that small tbh. Recursion is fine for reasonably sized canvas

  • @AryanK1511
    @AryanK1511 8 หลายเดือนก่อน

    What an amazing video

  • @Alien426
    @Alien426 3 ปีที่แล้ว

    Just what I needed. Thanks.
    The only gripe I have is with the variable names:
    @6:00 n, m, i, j are not descriptive at all. I would rename "m" to "iWide", "n" to "iHigh", "i" to "iRow", "j" to "iCol"/"iColumn". I know the variable names are better @7:30, but one will run out of single letter names pretty fast. In my opinion it's better to type a little more and be clearer than to save a few keyboard strokes.
    I like to use Hungarian notation with a single letter for the type (in Python: bVar for boolean, iVar for integer, fVar for float, lVar for list, tVar for tuple, ...), but I guess it's out of fashion for some reason.

    • @insidecode
      @insidecode  3 ปีที่แล้ว +2

      I think that n, m, i and j are the standard variable names when dealing with matrices, where n and m are the dimensions (rows and columns respectively) and i and j the coordinates of the actual cell

  • @ThibJoker
    @ThibJoker 2 ปีที่แล้ว

    Just what I needed, thank you !

  • @Jana-vv5qx
    @Jana-vv5qx ปีที่แล้ว

    Very nice code

  • @procode6881
    @procode6881 3 ปีที่แล้ว +1

    Wonderful,great explaination man

  • @francescopiazza4882
    @francescopiazza4882 2 ปีที่แล้ว

    Many thanks, pal !

  • @charlescampista9384
    @charlescampista9384 2 ปีที่แล้ว

    Very well explained! Thanks!

  • @leilaborromeo
    @leilaborromeo 3 ปีที่แล้ว +1

    your videos are so helpful :)

  • @gettykung1185
    @gettykung1185 ปีที่แล้ว

    Thank you!

  • @arsenbabaev1022
    @arsenbabaev1022 3 ปีที่แล้ว

    Wow, calculating islands or biomes is exactly what I was looking for. It will come out soon? or already did

  • @ayt_daily
    @ayt_daily 2 ปีที่แล้ว

    That's awesome. Thank you!!
    Besides, is the magic wand tool method the same as this? can you explain later?

    • @insidecode
      @insidecode  2 ปีที่แล้ว

      You're welcome! Yes magic wand tool uses flood fill, it keeps expanding until it finds pixels with whom the difference is higher than the tolerance. I'll try to make a video on it

    • @ayt_daily
      @ayt_daily 2 ปีที่แล้ว

      @@insidecode Yes thank you, i'll wait :D

  • @prernagolani9014
    @prernagolani9014 2 ปีที่แล้ว

    very nice video

  • @gamermoneyfree8193
    @gamermoneyfree8193 2 ปีที่แล้ว +1

    I'm getting recursive limits exceed in python while implementing

    • @insidecode
      @insidecode  2 ปีที่แล้ว

      How much is the size of your grid?

    • @gamermoneyfree8193
      @gamermoneyfree8193 2 ปีที่แล้ว

      @@insidecode my circle radius is 50 but for smaller radius circle it works
      Is there any way to run it on large radius size without getting error

    • @insidecode
      @insidecode  2 ปีที่แล้ว +1

      @@gamermoneyfree8193 you can modify the recursion limit with sys.setrecursionlimit, or you can use BFS instead of DFS to avoid recursion

    • @gamermoneyfree8193
      @gamermoneyfree8193 2 ปีที่แล้ว

      @@insidecode ty for response

    • @insidecode
      @insidecode  2 ปีที่แล้ว +1

      @@gamermoneyfree8193 you're welcomee

  • @rahulsingh-cn7dv
    @rahulsingh-cn7dv 2 ปีที่แล้ว

    Thankyou so much..... !

  • @definite_d
    @definite_d 8 หลายเดือนก่อน

    1000th like. Great video.

  • @samarthtandale9121
    @samarthtandale9121 3 ปีที่แล้ว +1

    Made the 200'th like 😁

  • @GameplayDexter
    @GameplayDexter 2 ปีที่แล้ว

    Hello, Is there any way someone could send me a copy of this when the code is working with pygame (BFS version), as I have trouble implementing the source code linked under the video.? If yes, thank you!

  • @Kyoz
    @Kyoz 2 หลายเดือนก่อน

    🤍

  • @adamekhobba2156
    @adamekhobba2156 6 หลายเดือนก่อน

    🟥🟩