To make this a hook: instead of including the actual invert code right here, provide an opportunity for a callback to be called here.

Actually, we can do this with an event, just like the `tile-drawn` event above it. Here you can have a `frame-drawn` event, and pass things like the canvas and the context. Then a plugin can listen for the event and do its thing.

Meanwhile you should write the invert plugin and we can use it on our upcoming plugins page. Here are some more thoughts on plugins: https://github.com/openseadragon/openseadragon/wiki/Making-OpenSeadragon-Plugins

I hope that answers your question about what I mean by a hook... happy to give more detail if needed. :-)