I have png-images of a grayscale circle and background alpha
I would like to extract the 50% contour (only the diagonal line) and export it as a path into an svg-image. Until now I tried to do this with ImageMagick and Potrace, but I was not able to get the desired result:
The following command gives me the complete area, but not the border. After opening it in Inkskape I can by hand make the contour transparent and add a color to the border and maybe afterwards also delete the parts of the circle which I don't want to have. But I would rather have something which runs automatically.
convert input.png -threshold 50% pgm:- | potrace - --svg --invert > result.svg
I can extract only the border first with ImageMagick, but also a part of the circle. I think I would be able to maybe put a mask on the result to delete the circle again, but then if I try to use potrace to generate an svg-image, I can only get a shape of the form of the contour, but not a path.
convert input.png -threshold 50% -edge 1 pgm:- | potrace - --svg --invert > result.svg
Maybe there is a completely different way to achieve what I want to have. It would be nice to do this by standard tools from the command line and not by hand or by writing a script to do it completely from scratch.
Here is how to extract your 50% line in Imagemagick. (To convert to SVG, see https://imagemagick.org/Usage/draw/#svg_output)
If you want just the coordinates, then in Unix syntax
You may want to reduce the fuzz value to get a narrower line.