These are chat archives for openseadragon/openseadragon

20th
Apr 2017
sohaib
@sohaib_ghani_twitter
Apr 20 2017 06:01

Thanks Ian. Vips worked very well. Now, I am its fan too. I have another question.
I am generating pixel based image of high resolution where each pixel color is representing some information. I then generate deep zoom tiles through vips and show it in the open sea dragon viewer. The problem i am getting is that in the open sea dragon viewer when i am zooming down pixels seems to be distorted. In the original image if i zoomed in, at the lowest zoom in level i can clearly see pixels. In the generated deep zoom tiles as well, at the highest tile level each tile image can be zoomed in to see clear pixels. Why open sea dragon not showing clear pixels at the zoom in?
Here is what i am using for open sea dragon viewer

viewer = OpenSeadragon({
id: "contentDiv",
prefixUrl: "/openseadragon/images/",
toolbar: "toolbarDiv",
visibilityRatio: 1,
constrainDuringPan: true,
// panHorizontal: false,
defaultZoomLevel: 0,
minZoomLevel: 0,
maxZoomLevel: 100,
showNavigator: true,
navigatorPosition: "TOP_RIGHT",
wrapHorizontal: false,
animationTime: 2,
springStiffness: 5,
sequenceMode: true,
tileSources: [
"/example/duomo/linear/y.dzi",
"/example/duomo/linear/c1.dzi",
]
});

Original image: https://www.dropbox.com/s/m7zj572vr1bizk3/y.png?dl=0

Here are the deep zoom tiled images.
https://www.dropbox.com/sh/gt1hbp9ic15qtzv/AABUA-_jHaEOuyx26OBNRVUBa?dl=0

I zoomed in one of the highest level tiles images to show how each pixel is looking at zoom in. (i took tile of level 13, 4_3)
https://www.dropbox.com/s/x0y6uphp1snzqwh/zoomed%20in%20tile4_3%20level13.PNG?dl=0

This image is zoomed in open sea dragon image: https://www.dropbox.com/s/4zbx07qqdpvdic5/zoomed%20in%20open%20sea%20dragon%20image.PNG?dl=0

Please let me know how i can see clear pixels at zoom in in open sea dragon. Thank You so much.

sohaib
@sohaib_ghani_twitter
Apr 20 2017 08:58
I try to find a solution and find that open sea dragon is using an interpolator to upsize images. I want hard pixel edges, but open sea dragon is using something like bilinear (soft edges). am i right? How can i turn off the interpolation? Thanks
Ian Gilman
@iangilman
Apr 20 2017 17:13
@sohaib_ghani_twitter OpenSeadragon uses Canvas and by default Canvas uses a smooth interpolation. You can turn it off with https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled
You'd do something like viewer.drawer.context.imageSmoothingEnabled = false
sohaib
@sohaib_ghani_twitter
Apr 20 2017 20:35
Thanks Ian. I will indeed try it.