These are chat archives for openseadragon/openseadragon

27th
Sep 2018
Harshali Talele
@harshalitalele
Sep 27 2018 09:30

The major issue right now I am looking into is-

I have used canvas for drawing freeform annotations, which get stretched on zooming the openseadragon image.
Because of this stretching, the linewidth of the annotation also gets stretched/increased on zooming. I don't want that.
I want to maintain the linewidth to, say, 5px for all the zoom levels.

Redrawing annotations on every zoom is not good performance-wise.

So I am trying to figure out way to achieve this with better performance.

Ian Gilman
@iangilman
Sep 27 2018 16:19
@harshalitalele Are you using the canvas overlay plugin? Actually, redrawing on canvas every frame can be not too bad, as long as your graphics aren't too complicated. At any rate, I don't think you'll be able to avoid redrawing every frame (at least during zoom) if you want the line thicknesses to stay the same.
Harshali Talele
@harshalitalele
Sep 27 2018 17:00

No, I am not using the canvas overlay plugin.
But the freehand annotation gets me set of points that can be huge and I just connect all these points in sequence using line on canvas.
So the performance thing depends on number of points generated while drawing.

I will check the plugin.

Ian Gilman
@iangilman
Sep 27 2018 17:07
@harshalitalele You might consider doing some sort of path simplification. Paper has a good one: http://paperjs.org/examples/path-simplification/
... And there's a Paper overlay plugin for OSD: https://github.com/eriksjolund/OpenSeadragonPaperjsOverlay
Harshali Talele
@harshalitalele
Sep 27 2018 17:18
path-simplification is really interesting.
It reduces a lot of number of unnecessary segments.
Thanks a ton! I think this will work :)
Ian Gilman
@iangilman
Sep 27 2018 17:19
Cool :)