In my game, I need a way to produce convex polygons from pngs of objects.
For example, a maple leaf would result like this:
Essentially right now, the way my algorithm works is by putting all pixels that have an alpha of 255 in a list. I then create a convex hull from this list, and finally optimize the hull with a graph algorithm. The part I'm trying to optimize is the first part. I'd like a way to have the outline / border pixels of the shape rather than all pixels of the shape.
What sort of algorithm could do this?