I'm using the Chipmunk physics engine to make the levels for a 2D C game. I'd like to be able to fit a polygon to an arbitrary shape to serve as the collision mask. Given a black and white collision mask for an arbitrary level object like this:
Are there any well-known algorithms for getting this:
I could then use the red polygon to create a physics object to go with the image.