Seed fill algorithm
A seed fill algorithm starts with a known initial interior point of the polygon and spreads out to determine other interior points to fill the given closed area with specified color. Four connected and eight connected pixels are used to determine other interior points for painting with specified color.