Given an image such as below the goal is to find a shortest route from a coordinate to another coordinate on the image space. The route to follow black pixels.
Using distance-weighted minimum cost path (MCP) implemented in ACLib it is quite easy to achieve the goal on any image size.
A close-up view of the top-left corner, i.e., the beginning is shown below.
A close-up view of the bottom-right corner, i.e., the end is shown below.