I have several png files that look similar to this this:
Everything is transparent but the black path. What I am trying to do is create a UIBezierPath from the non transparent part.
Edit: So I was thinking what about creating a mask with the png then from the mask go to a UIBezierPath. Would that work?
Edit Again: I found the solution, look at my answer.
I went a different direction. Instead of using PNGs I went with SVG and used PocketSVG to parse the file. It works great.
The process you're looking for is known as skeletonization, there's a good summary of techniques in this post: Determine the midline of a bent, elongated region
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With