UIBezierPath from UIImage removing transparent pixels

Viewed 243

Input Image With transparent background

Output: Bezier Path

Given an UIImage with transparent background, I want to calculate bezier path for image excluding transparent pixels ? (like in output image dotted path you can see)

Is there any best way to achieve this?

I have one solution: 1. Detect edge using GPUImage with 1.0 precision - image1 2. Detect edge using GPUImage with 2.0 precision - image2 3. image3 = image2 - image1. 4. iterate through each pixels and where ever dark point found just put that coordinate in bezier path.

What could be better solution ?

0 Answers
Related