Center of a 2D Texture with ALPHA (PNG)


Hi fellows! What is best way to find the center of a texture with alpha?
I’m doing it with pipet, but I wonder if there’s some best way

also, how can I do it, if I got more PNG and I want to process them all together?
Scomposition (42.9 KB)


what do you mean by “find the center of a texture with alpha”? the average color?


aha perhaps is kind of confused question, I know
let’s say, the center of all the points with alpha>0
or even, the center of the “Bounding Box” containing all the pixel with alpha>0

as example, in the PNG “HOUSE” here, the center is the red cross



convert the image to have all transparent pixels black, the rest white. then find the Contour and take its center. when doing it with VL.OpenCV you should be able to nicely batch-process a bunch of pictures async…