IIIF – The International Image Interoperability Framework

IIIF - The International Image Interoperability FrameworkThe International Image Interoperability Framework (IIIF) is a protocol for standardized image retrieval created by a community of the world’s leading research libraries, major national libraries and not-for-profit image repositories in an effort to collaboratively produce an interoperable technology and community framework for image delivery.

These include the research libraries of the universities of Stanford, Yale, Harvard, Cornell and Oxford University’s Bodleian Library. National Libraries including the British Library, the BNF (the French national library) and the Royal Library of Denmark. And not-for-profit image repositories including the Wellcome Trust’s Library.

The goals of the project are to:

  • Give scholars an unprecedented level of uniform and rich access to image-based resources hosted around the world
  • Define a set of common application programming interfaces (APIs) that support interoperability between image repositories
  • Develop, cultivate and document shared technologies, such as image servers and web clients, that provide a world-class user experience in viewing, comparing, manipulating and annotating images

IIIF consists of an image API and a presentation API. The Presentation API provides structural and presentation information, whereas the image API provides a standard image delivery API.

The IIPImage server, iipsrv fully supports version 2.0 of the image API in the development code on github and this will be included in the forth-coming 1.0 release of iipsrv. (If you need IIIF API 1.x compatibility, use this earlier iipsrv-based implementation by Klokan Technologies).

The image API syntax is essentially the following:

{scheme}://{server}{/prefix}/{identifier}/{region}/{size}/{rotation}/{quality}.{format}

where it is possible to specify a region within an image, the size at which the image should be output, rotation, mirroring and whether the output should be greyscale or color. Sizes can be expressed in either absolute pixels or percentages; and rotations of 90°, 180° and 270° are supported by iipsrv.

For example, to export an image test.tif uncropped, resized to 400×400 pixels, rotated by 90° and converted to greyscale, use the following URI:

test.tif/full/400,400/90/grey.jpg

Image metadata and a list of server capabilities is available through an info.json request, which provides information on the image and the functionality provided by the image server:

test.tif/info.json

iipsrv supports full level 1 compliance of the specification and almost all of level 2 (currently only missing PNG export). As well as optional advanced IIIF features such as mirroring and resizing to > 100%. The server also passes the online IIIF validator conformance tests.

The protocol can be used in parallel to the existing IIPImage support for the IIP, DeepZoom and Zoomify protocols within both iipsrv and iipmooviewer.

More information on the IIIF initiative is available from the IIIF website, including a list of IIIF compliant software and a showcase of IIIF in action, which includes, of course, IIPImage:

IIPImage and IIIF: iipsrv and iipmooviewer using the IIIF protocol (click to open viewer)

Using IIIF with iipsrv

iipsrv uses the IIIF=<IIIF request> command in order to run IIIF requests, where the IIIF API syntax described above forms the argument to this. A typical IIIF request will, therefore, look like the following:

http://your.server/fcgi-bin/iipsrv.fcgi?IIIF=image.tif/full/400,400/90/default.jpg

URL Rewriting

In order to obtain a cleaner URL, you will need to use URL rewriting within your web server to eliminate the FCGI prefix and iipsrv-specific command to the request. Most web servers include functionality to achieve this, allowing a URL such as the following to be made available, which will map internally to the full path described above:

http://your.server/iiif/image.tif/full/400,400,90,default.jpg

This can be achieved with Apache and mod_rewrite using the following:

RewriteRule ^/iiif/$ /fcgi-bin/iipsrv.fcgi?IIIF=

And with Lighttpd and_mod_rewrite:

url.rewrite-once = (
  "^/iiif/(.*)"  => "/fcgi-bin/iipsrv.fcgi?IIIF=$1"
)

And similarly with NginX and ngx_http_rewrite_module:

merge_slashes off;
rewrite ^/iiif/(.*) /fcgi-bin/iipsrv.fcgi?IIIF=%2F$1 last;

IIPMooViewer

IIIF is also supported client-side within iipmooviewer, allowing iipmooviewer to be used with any IIIF compliant server. IIIPMooViewer supports both the older version 1.1 API as well as the current 2.0 specification and will automatically switch between them.

To use IIIF, simply specify IIIF as protocol and make sure the server parameter points to the IIIF-enabled end-point. For example, this would be /iiif/ if you are using iipsrv and have enabled URL rewriting. Otherwise this would be the full path: /fcgi-bin/iipsrv.fcgi?IIIF=

// iipmooviewer constructor
   new IIPMooViewer( "viewer", {
	server: "/iiif/",
	image: "image.tif",
	protocol: "IIIF"
   });

See the iipmooviewer documentation for more details on other iipmooviewer functionality.

IIIF Event: Sharing Images of Global Cultural Heritage

To launch version 2.0 of the IIIF API, the project hosted a one day dissemination event entitled Sharing Images of Global Cultural Heritage hosted at the British Library in London on the 20th October 2014. The event focused on how museums, galleries, libraries and archives, or any online image service, can take advantage of interoperability between image repositories and was well attended by a wide range of cultural heritage professionals.

The presentations included demos from IIIF-enabled software such as Loris, Mirador and the Wellcome Player as well as case studies from participant institutions such as the Universities of Stanford and Yale, the Bodleian Library, Oxford and the Royal Library of Denmark.

The IIPImage presentation and demo covered the background to IIPImage, it’s more advanced functionality, case studies of IIPImage use and the IIIF implementation within iipsrv. The full presentation is available below: