I've been meaning to post some demo source code for this for months, but I finally have gotten around to it.
When I wrote my first game, I wanted my vehicle to follow the path of the terrain I was making. Creating chipmunk shapes to match the terrain was not very fun, especially if I wanted randomly generated terrain.
So I created a little subroutine that reads in a PNG that has it's background transparent, and basically traces the image and creates an array of points that are then used to make a matching set of segments for chipmunk.
There doesn't seem to be an option to upload a file here in this forum (?), so here is a link to the entry on my blog.
http://steveweintraut.blogspot.com/2010/04/2d-terrain-mapper-for-use-with-iphone.html
Basically, it will shows you a ball that will fall from the sky and follow the path of the 2D background. If you were to open the project and change the PNG, the next time the project was run it would simply generate a new set of chipmunk segments based on your new background image.
Note: the code could be a lot cleaner, but rather than wait for another month (or more) to share it, I decided to release the demo as is. It still works however.