Algorithms & EmergenceAlgorithms

The Paint Bucket

Filling a shape is a graph search in disguise

One click fills a shape perfectly, until one missing pixel floods the whole picture. How does the paint bucket know where to stop?

You'll find out

  • How paint finds every connected pixel
  • Why one pixel can flood everything
  • What paint has to do with islands

Why it matters

Paint buckets, magic wands, game maps and island counts all run on one simple search through neighbors.

About 3 min6 interactive slides · 5 questionsLesson 226 · Zone 26

Play this lesson

Free to play in your browser or on iPhone

More in this zone

  1. 227Sound DesignThe Foley ArtistMovie punches are often celery and leather jackets
  2. 228Internet HistoryThe First SpamIn 1978 an ad was emailed to 400 people, and they were furious
  3. 229AI SecurityThe Panda That Became a GibbonInvisible changes can fool image recognition completely
  4. 230Motion IllusionsThe Flash-Lag IllusionMoving things look ahead of where they really are
  5. 231SpaceflightWhy Rockets Launch EastEarth's spin gives every rocket a free push
  6. 232Applied MathematicsThe Wobbly BridgeLondon's Millennium Bridge swayed because walkers fell into step
  7. 233GeometryOnly Five Perfect DiceThere are exactly five shapes with identical regular faces
  8. 234Cloud ComputingThe Cloud Is a BuildingYour photos live in giant warehouses full of humming computers