UIBezierPath with Image

I have several png files that look something like this:

enter image description here

Everything is transparent, but the black way. I am trying to create a UIBezierPath from the opaque part.

Edit: So I was thinking of creating a mask using png, then from the mask, go to UIBezierPath. Will this work?

Edit again: I found a solution, look at my answer.

+4
source share
2 answers

I went in a different direction. Instead of using PNG, I went with SVG and used PocketSVG to parse the file. It works great.

+4
source

The process you are looking for is known as skeletonization, there is a good summary of the methods in this post: Define the midline of a curved, elongated area

+1
source

Source: https://habr.com/ru/post/916344/


All Articles