Skip to content
Solely for the Purpose of Catching $PAMRZ

JPEG2000 to Zoomify Shim — Creating JPEG tiles from JPEG2000 images


This is a textual representation of a lightning talk done on Feb 26th at Code4Lib 2008. When the video of the talk is up (thanks, Noel!) I’ll link it here, too. The video is now available, and that article includes an update on progress since the this article was posted.

OhioLINK has a collection of JPEG2000 images as an access format that were generated for use in our DLXS-based content system. We are in the process of migrating those collections to DSpace and were looking for a mechanism to leverage the existing JPEG2000 files and not have to generate new derivatives. We are also considering the use of JPEG2000 as a preservation format, and would find it attractive to use the same image format for both access copies and preservation copies. We looked at Zoomify, but to perform its scaling function it generates JPEG tiles at several resolutions and storing those tiles can triple or quadruple disk space requirements. Or, one could use the ‘enterprise’ version of Zoomify and its proprietary PFF format or the equally proprietary MrSID format. We didn’t want to be locked into either of these scenarios. Our solution is to create a web application that mimics the directory-of-JPEG-tiles solution, but to dynamically generate the tiles our of a JPEG2000 master.

The free version of Zoomify reads JPEG tiles out of a directory structure that looks like this:

/ImageProperties.xmlIncludes descriptive elements of the source image like height, width, and tile size./TileGroup0/0-0-0.jpgThe highest power-of-2 zoom out level that creates an image with dimensions less than 256×256/TileGroup0/1-0-0.jpgThe tile at the upper left corner at the first power-of-2 zoom level/TileGroup0/1-1-0.jpgThe tile to the left of 1-0-0.jpg

The shim mimics that directory structure. It parses the URL of the request and dynamically creates the appropriate JPEG tile (or metadata file) out of the JPEG2000 image.

The Code


The JPEG2000 for Zoomify shim requires Java 1.5 or greater. It does not require a servlet engine; rather, it uses the Restlet library to perform as a stand-alone application. The OneJar library allows the Java classes and required dependencies to be bundled into a single JAR file. We’re using the Kakadu Software JPEG2000 library to perform the on-the-fly decoding of JPEG2000 images. Kakadu is a commercial JPEG2000 codec, although inexpensive licenses are available for not-for-profit activity. We are using the Enterprise version of Zoomify, a Flash-based image viewer, although I believe the free version will work as well. (You’ll need the Enterprise version to be able to modify and adapt the appearance of the Zoomify applet.) The same techniques can also be used for other Flash applets and probably even JavaScript-based viewers (a la Google Maps).

The source code is available from the OhioLINK DRC source code repository (Subversion access). We plan to integrate it into DSpace 1.5 as part of the Ohio Digital Resource Commons, and I may create a Fedora disseminator to serve up the tiles as well.

Thanks go out to Keith Gilbertson and John Davison on the OhioLINK staff for their help in making this work as well as Stu Hicks and François d’Erneville for being a sounding board for these ideas.

(This post was updated on 15-May-2008.)

5 Comments

  1. Rob Lancefield | February 28, 2008 at 10:25 am | Permalink

    Great to know about this, Peter. Thanks for posting! –Rob

  2. Chris Freeland | March 6, 2008 at 3:36 pm | Permalink

    Have you looked at GSIV for delivery? The Biodiversity Heritage Library is also delivering JP2 via JPG tiles (see this example page), but we’re using the proprietary LizardTech ExpressServer to decode (we were long-time MrSID users) and the open source GSIV for display in the browser. Worth looking into if you haven’t already.

  3. Nick Ruest | March 31, 2008 at 3:40 pm | Permalink

    @chris

    What version of LizardTech ExpressServer are you running? We are having a problem with it not rendering in mozilla based browsers, and Safari < 3.

    thanks!

  4. Etienne Posthumus | May 14, 2008 at 6:48 am | Permalink

    What a great idea.

    We had similar problems with the disk space requirements mushrooming for large collections, and the time required to generate the tiles for each new image. My solution was to not Zoomify the images (we use plain Jpeg) but make a custom Flash viewer using Actionscript that loads the entire file. With networks speeds being so fast it is feasible.

    But now, you have given me an idea that it would be doable to also dynamically dish up Zoomify tiles for large Jpeg files server-side. Would need a simple Python script to do. I will add this to my TO-DO list… ;-)

  5. the Jester | May 15, 2008 at 2:52 pm | Permalink

    @Etienne –

    Thanks for the kind comments. Some of the files we’re working with are several 10s’ of megabytes in size, so dumping them across the net to the browser isn’t a great option for us. I’d be curious to hear about how your script to generate the Zoomify tiles using Python works out; let me know!

5 Trackbacks

  1. [...] of Code4Lib 2008 presentations possible. I just had a chance to notice that the video from my JPEG2000 to Zoomify Shim lightning talk was [...]

  2. OpenLayers Zoomify Example | June 3, 2008 at 6:51 pm | Permalink

    Kramer auto Pingback[...] Zoomify tiles can be also served dynamically on the server side from JPEG2000 masters using J2KTileRender with available integration for DSpace and soon for Fedora Digital Repository. IIPImage server can [...]

  3. Museums - Zitgist Wiki | June 19, 2008 at 3:57 pm | Permalink

    Kramer auto Pingback[...] Here are a few museum blogs that are pretty decent: http://culturalsemanticweb.wordpress.com/ , http://dltj.org/article/introducing-j2ktilerenderer/ , http://www.code4lib.org/ , http://www.powerhousemuseum.com/dmsblog/ Also, see Second Story? [...]

  4. Kramer auto Pingback[...] and developer of the IIPImage and scientist in Laboratories of Louvre Gallery.Note: a project j2ktilerenderer is also generating Zoomify tiles - from JPEG2000. Vystavil Klokan Petr Přidal v 1:05 [...]

  5. Kramer auto Pingback[...] [5] Murray, P. (2008, February 28). JPEG2000 to Zoomify Shim – Creating JPEG tiles from JPEG2000 images. Disruptive Library Technology Jester. <http://dltj.org/article/introducing-j2ktilerenderer/>. [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
Human Detection Scheme
(What's this?)
Comment Preview

Subscribe without commenting

From the Disruptive Library Technology Jester (http://dltj.org/), printed on Wednesday the 12th of November 2008 at 8:54:34 PM EST (-0500). The URL to this page is http://dltj.org/article/introducing-j2ktilerenderer/

[Creative Commons Logo] This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/us/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.