I’m exploring the idea of converting images into bounding shapes, using a transparency color (or alpha for png’s), as a method for doing pixel perfect collision.
Of course, this can quickly turn into a CPU taxing problem. I could just hit every pixel, and add all non-transparent ones to a polygon. But, that’s far too many points, and it’s just a slow process to go through every pixel in an image.
Another though would be to check every pixel, but only add the bordering pixels to create an outline. This reduces the point count, but is still checking every pixel.
A third thought was scanning until I found the first non-transparent pixel, as this would definitely be on an edge, and then only checking pixels around it for other border pixels, And just making my way around the image. I could use a scalar to reduce the number of points actually added.
Finally, my question is if this is an accepted approach to pixel perfect collision. Or, do people generally just use the pixel colors directly to check for overlap?