IIIF implementation

Published: Dec 10, 2021 by Steve Baskauf

In connection with uploading files to Wikimedia Commons as part of our WikiProject Vanderbilt Fine Arts Gallery, I’ve been working on the details of uploading images to the Vanderbilt LibrariesCantaloupe International Image Interoperability Framework (IIIF) server and providing IIIF manifests to describe them.

This required working out a number of technical details. Making the images available to the server required uploading them to an AWS S3 bucket. This was done using the boto3 library of the AWS Python SDK as part of the Commonsbot script I use to upload images to Commons.

While doing the image upload, I also created a simple JSON IIIF manifest for each image, based on the pattern used by the National Gallery of Art with images they’ve uploaded to Commons. The manifests are served directly from another S3 bucket and are also generated and uploaded by Commonsbot.

With the image accessible from the IIIF server and the manifest in place, I could then create a link to the manifest in the Wikidata item for Public Domain works in the Fine Arts Gallery using the P6108 “IIIF Manifest” property. There is a user script that enables an embedded Mirador IIIF viewer when a Wikidata user adds the line

mw.loader.load( '//www.wikidata.org/w/index.php?title=User:Btwashburn/iiif-mirador.js&action=raw&ctype=text/javascript' );

to their common.js page. Once the user script is enabled, the viewer automatically displays the image for any item with a P6108 property, such as https://www.wikidata.org/wiki/Q103306985. This is cool because you can zoom into details on the image as shown above.

One issue that was difficult to work out was converting the high resolution TIFF images from the format produced by the imaging camera to the “tiled pyramidal” format required by the IIIF server to serve smaller versions or closeups of the image quickly. (For a good explanation of image pyramids, see the first part of this video.) After trying a bunch of different methods to script the conversion, I was finally successful using command line ImageMagick for Mac based on the examples in this post. I was able to script the conversion in Python using these statements:

import os
os.system('convert 1979.0342P.tif -define tiff:tile-geometry=256x256 -depth 8 ptif:1979.0342P_tiled.tif')

where 1979.0342P.tif is the name of the file to convert.

Share

Latest Posts

Enabling ecological survey data integration
Enabling ecological survey data integration

Our paper describing the Humboldt Extension to Darwin Core has been published in Ecography. The Humboldt Extension adds 55 terms that enrich the Darwin Core, providing the terms needed to capture and share multiple types of biodiversity survey data. The paper illustrates the benefits of implementing the Humboldt Extension with three case studies and demonstrates how richer data can be used in research, modelling, and to inform decision-making.

Biological survey and monitoring data publishing guide
Biological survey and monitoring data publishing guide

My coauthors and I have published a guide to help people understand how to use the new Humboldt Extension for Biological Inventories of the Darwin Core standard. The guide includes diagrams and detailed information about how to structure the data to capture the hierarchical structure typically found in monitoring projects.

Open Science recipes published
Open Science recipes published

My colleage from the Vanderbilt Libraries’ Digital Lab, Shenmeng Xu, an I have published two chapters in the ACRL’s 2025 Open Science Cookbook. The Cookbook is a lighthearted take on technical topics where instructions are given in “recipe” format to teach beginners new tech skills.