Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rasterising SVG to image tiles instead of to the window #8

Open
eriksjolund opened this issue Aug 30, 2015 · 2 comments
Open

Rasterising SVG to image tiles instead of to the window #8

eriksjolund opened this issue Aug 30, 2015 · 2 comments
Labels

Comments

@eriksjolund
Copy link

It seems the SVG is drawn on to the window as soon as some zooming or panning happens.
Let's say we have a use case where the drawing of the SVG is compute intensive and that the SVG doesn't change too often.
Would it make sense to let OpenSeadragon draw the SVG to image tiles with alpha channel instead of to the window?
Maybe zooming and panning would be more smooth?
Would there be a difference in anti-aliasing?
Could this plugin support drawing the SVG to image tiles?

@iangilman
Copy link
Member

When you say compute intensive, do you mean that it takes a lot of work to construct the SVG originally (prior to the browser rendering the SVG), or do you mean that it takes a lot of work for the browser to render it?

If it's the former, then sure, you could construct it in the background (either in web workers or in little chunks on the main thread) and add it as it becomes ready. It would make sense to keep it SVG, though.

If it's the latter, then yes, maybe it would be worth drawing in pixels directly on the tiles. You'd have to keep in mind all of the different tiles and their different levels, so you can draw the right thing in the right spot. Rather than using this plugin, you'd probably use the tile-loaded event that's been added recently (openseadragon/openseadragon#659 ... you'll have to use OpenSeadragon master, as it hasn't been released yet).

@eriksjolund
Copy link
Author

It is the latter that I am worried about. The more detailed more and complex the SVG is, the longer it will take to rasterise the SVG. It seems unnecessary to rasterise the SVG for every little pan or zoom change. Thanks for the tips of using the tile-loaded event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants