As an example, imagine a 200x200 pixel wide PNG file. The entire file is transparent except
for a circle in the dead center that has a diameter of 100 pixels. The circle is black and the edges are aliased, but I don't want to use the circle's color at all in this question because I may have 1000 images with the circle being different or multi-colored.
What I need to do is this:
Open the PNG and find the x/y coordinate of the first pixel that is NOT transparent on the left, top, right and bottom of the circle. All I care about is those four points. Note that the size of circle may change so I need to do this dynamically.
If I were using exactly what I said the script should come back with:
150, 100 (right)
I've gone through the GD functions and can't seem to find the right tool or the right combinations.
Can anyone help please!
Thanks in advance!