Libvips: DZI Questions

Created on 27 Sep 2019  路  3Comments  路  Source: libvips/libvips

Hello!

Thank you for such a wonderful library. I'm using it to convert mirax whole slide files to deep zoom, to be displayed with OpenSeadragon. My question is twofold:

  1. Is there a way to extract an area from the image with vips (pyvips), once it's been converted to DZI? Currently, we're using Openslide to cut regions of interest from the mirax slide, and saving the cut regions as png files (they are then assembled to form an aggregate image - our slide classifier). This means we need to keep both the mirax files and the DZI files on our server, which is quite cumbersome. We'll also need to run the cutting process more than once, since end users will be able to select regions of interest from the client side as well.

We've looked into servers that support the IIIF protocol, which seems like it would make the area extraction process far easier. However, this brings me to my second issue:

  1. In order to use IIIF-ready servers, images need to be converted to TIFF format (I believe, but correct me if I'm wrong). The server then dynamically generates DZI tiles from the TIFF file and serves them up as needed. This process reveals two problems:
  2. While extracting areas with the IIIF Image API would be easy, I don't know if it would be possible or efficient to create png files of the extracted areas this way.
  3. As tiles are created by the server and served, the end user can see the tiles loading. We want to eliminate that as much as possible, so we chose to pre-generate our DZI files with vips. We also want to keep the number of format conversions as low as possible - instead of going from mirax to TIFF to DZI, we want to keep it to mirax to DZI.

Is there an advantage to undergoing an extra format conversion and using an IIIF-ready server? From my point of view, it doesn't seem useful given the better visual performance of displaying pre-generated DZI tiles.

I know my issue strays a bit from vips itself, so I really appreciate any advice you may have on this. Thank you again!

question

Most helpful comment

Hello @AKlein920,

  1. Once you convert to DZI that's it. It's a write-only format, at least for libvips. You can reassemble tiles to form images with a bit of programming, but I don't think I'd bother. It would be much better to work from the originals.
  2. Yes, libvips supports pyramidal TIFF and you can convert to PNG or whatever. The disadvantage of IIPImage is that there is some server load and that'll limit scalability,

I suppose I'd keep two copies of each image: a DZI for web display, and mrx (or possibly pyrtiff) for server-side processing.

All 3 comments

Hello @AKlein920,

  1. Once you convert to DZI that's it. It's a write-only format, at least for libvips. You can reassemble tiles to form images with a bit of programming, but I don't think I'd bother. It would be much better to work from the originals.
  2. Yes, libvips supports pyramidal TIFF and you can convert to PNG or whatever. The disadvantage of IIPImage is that there is some server load and that'll limit scalability,

I suppose I'd keep two copies of each image: a DZI for web display, and mrx (or possibly pyrtiff) for server-side processing.

@jcupitt Thank you so much! Do you think there'd be an advantage to keeping a tiff/pyrtiff over mirax? We'd like to hang on to as little as possible.

Sorry, no idea! You'll probably need to do some experiments.

Was this page helpful?
0 / 5 - 0 ratings