If you can identify some point in the largest region, then this will work and is much simpler
coords="260,260"
# first line: read original and create a fully white image the same size
# second line: clone the input and replace everything that is not white with black
# third line: floodfill the large black area with red
# fourth line: replace white with black and red with white and reverse the polarity to create a mask image
# fifth line: composite the original, the white image using the mask, trim and add white border
convert original.png \( -clone 0 -fill white -colorize 100 \) \
\( -clone 0 -fuzz 1% -fill black +opaque white \
-fill red -draw "color $coords floodfill" -alpha off \
-fill black -opaque white -fill white -opaque red -negate \) \
-compose over -composite -trim +repage -bordercolor white -border 10 result.png
If on Windows, replace the line end \ with ^, remove all other \, replace % with %%
See
http://www.imagemagick.org/Usage/windows/