I am trying to come up with an algorithm to tell the difference between water and land. I have a 2D array holding only 0’s(black squares) and 1’s(grey squares), which produces this image. I colored one of the water areas blue so you can see what is supposed to be water. Water are the areas that are large and have a round shape. I colored some land areas green. All of the straight black lines are supposed to be land as well as some of the smaller round shapes.
Right now, all the black areas are represented as 0 and all grey areas as 1. So in the picture, the green and blue spots are both represented as being the same thing. I need some of the black areas(water) to be represented as 2 instead. What is a good way to do this? The best thing I came up with so far is to calculate the area of each black spot, and only allow areas above a certain threshold to be water. I think there are better ways though and am wondering what you guys think.

By combining the first two suggestions, I was able to come to a solution. I first look for water tiles that are surrounded by an arbitrary number of water tiles(i.e 4 in each direction) and then use the flood-fill algorithm to set the entire body of water to actually be water. Here is a picture of the
result. I added a coastline as well for looks. As you can see, the smaller round bodies are still land, which is exactly what I wanted.