I am looking to implement a interactive image system for dynamically generated content. The image includes a background image and various grey-scale mask images.
Background Image:
https://i.sstatic.net/NWzQ1.jpg
(source: goehler.dk)
Masks:
https://i.sstatic.net/kx606.jpg
(source: goehler.dk)
, https://i.sstatic.net/NfCDP.jpg
(source: goehler.dk)
, https://i.sstatic.net/jqn9e.jpg
(source: goehler.dk)
, https://i.sstatic.net/x8gme.jpg
(source: goehler.dk)
, https://i.sstatic.net/pXD2h.jpg
(source: goehler.dk)
Each masked area should be highlighted on mouseover, clickable, and link to a specific page.
What is the most efficient way to achieve this? It needs to be responsive and work with a large number of masks.
I have researched two potential solutions so far:
A. Trace the masks and create imagemap coordinates for each one to overlay on the original image (although challenging, especially with complex masks).
B. Layer all masks on top of each other and search for white pixels when interacting with the image (potentially processor intensive with hundreds of images).
Are there any other simpler, more optimized, or elegant solutions that I may not have considered?
Any suggestions?
I would appreciate hearing from anyone who has experience with similar projects.