Create polygon outline for sprite

I tested to create an outline for a sprite and the make a simplified polygon (Using Douglas-Peucker) to use with box2d. I think I’ve seen something similar here before.

Here is the code if someone is interested.

Touch the screen to randomize a new object. I’m interested in using the watershed algorithm to be able to use photos and find an object in them. Lets see how that goes…

Here’s a link to some code I wrote to create an outline. This is from 2019. I’m not sure where the original post is at in the forum.

Nice! The difference is that my code creates a vector outline. I found the old thread I was thinking about!