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.


Latest Posts

Birding in Puerto Rico
Birding in Puerto Rico

After recently making a trip to Puerto Rico that was primarily focused on bird watching, I decided to write a blog post to pass on some of what we learned. Much of the information that we got from books or the Internet was outdated or incorrect, so hopefully this post will help others to have an easier time finding good places to bird there.

QT Py RP2040 workshop
QT Py RP2040 workshop

I’m really excited to be working with Vanderbilt Science and Engineering librarian Francisco Juarez to develop a workshop series to teach participants to program the QT Py RP2040 microcontroller using CircuitPython.

VanderBot 1.9 supports somevalue
VanderBot 1.9 supports somevalue

One of the issues I discussed at my recent talk in the Art in Context: Identity, Ethics, and Insight symposium was the problem of representing anonymous artists in knowledge graphs. The solution that the Wikidata community has accepted is to associate a P170 (creator) claim with a somevalue snak having a P3831 (object has role) qualifier value of Q4233718 (anonymous). In RDF, this corresponds to a blank node and Wikidata claims using somevalue are represented by blank nodes in the Query Service.