Click map with pillow

I’m looking for pointers to making a click map with Pillow ie a way to map pixels to the event / object that caused those pixels to be changed. I wonder if any one knows of existing approaches.

I imagine I need to record lists of changed pixels as events happen and those should probably be ordered by the y value. Pillow does provide methods to obtain the difference images and I suppose searching the pixel rows should be fairly easy.

Mapping a click event back to it’s origin is thern probably a search and can be organised via the y lists using the event y and x.

You are using the term “click map” in a non-standard way, making it hard to understand what you want to do.

What are your inputs? What exactly do you want as output? Can you provide a simple example?

This is not what web creatures mean by click map. It’s more of an html image map.

Inputs: current image[i]
event[i]
new image[i]

Output: (set of pixels)[i] which differ and the event[i] later pixel associations replace earlier

After all the events have happened a click (which maps to x, y in the final image) can be used to perform some action on the associated latest event.