This is like what I would do since I think GIMP's plugin is my hammer and everything else is a nail

And since I am not great at efficiency here's my hackish way of attacking the problem.
First I would find a point in polygon function on the internet there are many resources that have them (in python).
1. Find the 2 shapes by:
- Loop through all the pixels (maybe not every pixel if shapes are always minimum a certain size, then maybe jump every 10 pixels). Find a black pixel.
- Use fuzzy select tool to select at that black pixel to select that shape. Turn it into path. call this path1. Turn path1 into array of points (rough estimates at equal distance around the path). Call this array poly1.
- do this for rest of pixels looking for the next black pixel that isn't (point in polygon of poly1).
- Use fuzzy select tool to select that 2nd pixel. Turn it into path. call this path2. Turn path2 into array of points (rough estimates at equal distance around the path). Call this array poly2.
2 - Decide that the two polygons aren't colliding by:
- for every point in poly1 check and make sure they aren't (point in poly2).
3 - Determine shortest distance between two shapes by:
- for every point in poly1, check against every point in poly2 to find minimum distance. this minimum distance is the shortest distance between the two shapes, while checking record where these two points (one point in poly1, and one point in poly2) that have the minimum distance.
4 - If the recorded 2 points are less than 50, draw your red X.
Probably not the most efficient, but all these steps are doing in GIMP.