Color Filler Algorithm
Assuming for simplicity that the edges don't touch the image boundary (you can always guarantee that by adding a pixel-wide "frame"), you can simply run flood fill from an arbitrary point on the image boundary.