It doesn't matter what shape they have or how large they are. The thing is, whatever way you turn it, each pixel needs to be tested once. Storing the position simply makes sure it's not tested more than once.
Also, flood fills usually is faster for smaller areas, basically, the speed per pixel is fixed.
In other words, regardless of the number of shapes, it boils down to:
* All pixels must be scanned once.
* All white pixels must be filled once.
You can't get away from that, and I'm pretty sure that my method is about as effective as it gets.