You can attach an event handler to one or more mouse events like this:
def my_handler(event):
# some stuff
canvas.events.mouse_release.connect(my_handler)
There are other ways to connect a function like this, but we'll stick with this way. Inside this function you'll want to convert your mouse click position in canvas space to visual space:
def my_handler(event):
if event.button == 1:
# left click
transform = your_image_visual.transforms.get_transform(map_to="canvas")
img_x, img_y = transform.imap(event.pos)[:2]
# optionally do the below to tell other handlers not to look at this event:
event.handled = True