Paint bucket tool and web surfing

RecursiveFloodFill4Directions-AndreKarwath RecursiveFloodFill8Directions-AndreKarwath

[ two animations of Flood Fill algorithms by Andre Karwath ]

It turns out that two things are true:

  1. Shopping at McMaster Carr can actually be good research, you will find the latest range here
  2. The Paint Bucket tool in Photoshop and web surfing are quite similar

Too complicated to explain why, but the McMaster site led me to Dijkstra’s algorithm, a method for determining the shortest distance between two points within a graph of many points.  Below is an animation by Steven Skiena showing the algorithm:

dijkstrasAlgorithm-LarryMak-StonyBrook

Dijkstra’s algorithm is used for sending packets over the internet (finding the shortest path of cable to send information) and possibly for route finding on Google Maps (pure conjecture).

The Paint Bucket uses a related algorithm called Flood Fill, Seed Fill, or Boundary Fill.  The animations at the top of the post show Flood Fills that look in four directions (left) and eight (right).  There are lots of other variations of the Flood Fill that work in different ways, mainly in how many times they repeat pixels.

The actual implementation of the algorithms is way beyond me, but the connection between routing of information and drawing in the computer is fascinating.

Leave a Reply

Your email address will not be published. Required fields are marked *