These are chat archives for openseadragon/openseadragon

30th
Aug 2018
Kevin Sjöberg
@KevinSjoberg
Aug 30 2018 07:58
Hey, I'm currently building an image filter plugin for OpenSeadragon built using Fabric.js. I've source dived quite a bit in order to fully understand what's going on. I have a lot of questions that I'd like to discuss with anyone that know the codebase very well.
  1. When using a deep zoom tile source, the tile-loaded event will contains an image property that is the loaded image. When using an image tile source, the tile-loaded event does not. Why is that? Diving into the source code I can see we delete the this._image reference for cleanup purposes. However, if you want to modify the image in tile-loaded it's more performant to use the generated image directly instead of generating ImageData from the provided canvas context.

  2. Is there a performant way to modify the image for tiles coming from image tile source?

  3. If context2D is present on a tile, the cache isn't used, when context2D is undefined, tiles are properly cached. I'm currently using the tile-loaded event to draw a manipulated image on a new canvas. I then take the canvas context and assign it to e.tile.context2D. This works, but it busts the cache since tiles with a context2D present does not get cached.

  4. Is it possible to modify a tile before being drawn, without busting the cache?

Kevin Sjöberg
@KevinSjoberg
Aug 30 2018 08:07
I'd be happy to pair program with anyone interested in looking at the problem. :slight_smile:
@iangilman any useful insight?
Ian Gilman
@iangilman
Aug 30 2018 16:20
@KevinSjoberg That aspect of OSD certainly isn't as clean or well structured as it should be. It's quite possible it needs some refactoring.
You might want to chat with @thejohnhoffer who is proposing some major changes in that area: openseadragon/openseadragon#1482
Another good person to talk to is @avandecreme who wrote https://github.com/usnistgov/OpenSeadragonFiltering and also the imageTileSource.
Ian Gilman
@iangilman
Aug 30 2018 16:25
I believe the image tile source doesn't go through the same tile loading process, since it just loads a single large image and then breaks it up into tiles itself on the client.
That said, there's probably a way to reorganize the tile pipeline so it works smoothly with all of these scenarios.
Kevin Sjöberg
@KevinSjoberg
Aug 30 2018 17:41
@iangilman thank you for that thorough response. You're right about the tile sources. The image tile source, just load the given image and generate a canvas context from it. The zoomable tile sources, do use the job queue.
@iangilman I'm experimenting with some different things tonight, I can push what I have. Would you or anyone else be up for looking at it?
Ian Gilman
@iangilman
Aug 30 2018 18:41
@KevinSjoberg Sure! Hopefully some of the folks I mentioned above also will be interested.