Image Comparison Slider Extension for plot overlays

I would like to have something like an image comparison slider (see or for heat maps.
I’m wondering if it’s possible to make this a bokeh extension of some existing implementations of overlays for any kind of plots. I imagine you could use this by passing two sets of data to a plot and the slider would let the user show one or the other data set.
Can someone hint me to the right direction of how this could work?

Hi @nritsche documentation for creating extension is here:

And in particular towards the end possibly the A New Custom Tool example might be the most relevant.

The links above all concern “regular” image formats, e.g. PNGs, I assume that is not the case here, and that you want this for colormapped “data” images on a plot? That’s going to be a fair bit more work. The links above can rely on simple CSS transformations built in the the browser to hide parts each image. For data images on plots it will be required to explicitly change how the image is drawn. In fact I think in addition to a custom tool, it would be required to make a new custom image glyph subclass as well, that has a configurable property to tell it “when to stop drawing”.