I have an interesting and challenging issue that I am trying to determine a solution for, if any solution is possible.
I am building a website where users have the ability to upload transparent PNG images onto a large map. The images appear on the map and then link to a location set by the user.
The issue is that the PNG images can be irregularly shaped. What I mean by this is that, while I am very much aware that the outputted PNG is always a square or rectangle, with transparency, the actual content inside that PNG file is often irregularly shaped.
What I would therefore like to do, is dynamically detect the shape of the content inside the PNG image and then generate a link area that goes around the content of the image only, and not the entire square/rectangular PNG image.
Is anything like this possible at the moment?
Obviously I am aware that you can manually draw and set shaped hyperlinks, but I am talking about taking it further and detecting the shape of the content in a transparent PNG and dynamically generating the shaped hyperlink.
If anyone is aware of a method of doing so, I would appreciate an answer here.
I will continue to research this myself and will post any findings as a potential answer.