Try a 4-way flood fill
Simpler flood fill
Take image path on command line
Better input image
Work with multiple input images