Is there a technique for turning an image into a 2d model? The overall goal is to create a print of the liberty bell.  No clapper is needed.  The support beam is not needed.  I am just looking to mimic the outside shape of the bell.  After an application of Google-fu I found this image.  It has been cleaned up and cropped a bit.



In OpenScad the surface function was applied to the png to generate a height model.   I subtracted out a few cubes, and eventually got it down to a layer of about .1 height.

My Evil (pun intended) plan is to get it down to a 2d model.  Then by shifting a copy of model from itself, and subtracting the two.  That should leave just the curve.  Then rotate_extrude the curve to generate the actual bell at the desired thickness.

I see the problem coming. If the model is layered down to zero height it will vanish. Leaving me nothing to rotate.

So on to the question.

Is there any tool or technique to turn the image into a 2d openscad object or failing that is there another way to approach the problem?

 

The direction that fred pointed me at is viable. I didn't use the actual image shown here, but a manually generated one from OpenScad.  As a proof of concept the technique works well.
As you are already familiar with OpenSCAD, consider to use the projection() function to accomplish your goal.

If you allow for an interpretation that one can cast a shadow of the part on a surface below, it becomes a 2D representation of the part. This is effectively how projection works in OpenSCAD.

Note that the part image below is centered in x, y, z and the cut/projection action takes place at the z = 0 plane:



When the function is applied to this model, the result is a non-contiguous 2d image:



When the cut parameter is ignored or set to false, the image which results is effectively an orthogonal shadow of the entire object, rather than a selected slice:



It gets better, of course. In OpenSCAD, the translate, rotate and scale functions apply. One can tip a model over, resize it, spin it around, combine with the cut parameter and get any combination of 2d image from the original model:





It's important to note that OpenSCAD does provide non-zero thickness to these projections when rendered, or maybe when previewed. I always get those two swapped around. As your objective is a 2D result, you may be able to select from PNG (save as image) or Export as DXF or SVG.

Re-reading your post, I also missed part of a more useful answer. Once you have the profile you desire, you can use the rotate_extrude function on the profile you generate. Despite the non-zero thickness, it uses the zero-thickness aspect to create the model from that function.

That aspect of the answer is left as an exercise for the reader, as the options are many and results can be complex.