IIIF Image Conversion Guide

IIIF Image Conversion Guide

The Europeana Natural History Aggregator OpenUp! has developed scripts for the IIIF image conversion process that can be used to install a IIIF server and perform a IIIF image conversion. The scripts are available for download and reuse from a GitHub repository.

This guide describes in detail how image collection owners and their technical support may utilise the scripts to make their collections IIIF-compatible.

1 Goal

IIIF stands for International Image Interoperability Framework (spoken Triple-Eye-F). The framework was created to offer the scientific community a way to productively interact with their digital objects (visual or audio/visual) and use them across different platforms. Here you can learn about the benefits of IIIF.

If you are looking for a general introduction to the IIIF framework, please check out the What is IIIF? training resources for aggregators.

The goal of this guide is to give you an example of how to make your digital images IIIF compliant. For that purpose you will have to run a web server and a IIIF-compatible image server and provide your images in a multi-resolution format (pyramid TIFFs). Pyramid TIFFs are layered documents that contain multiple, mapped versions of the same image in different resolutions. This allows image servers to optimize zooming, as they switch to higher resolution images as the user zooms deeper and deeper into the document.

img-conv-process.png

Main contents of the guide

Glossary and scripts

  • You will find links and information on the most important technical terms in the glossary of chapter 8.

  • And finally, in chapter 9, you will find the information from where to download the image conversion script and a script to install the web server and the IIPImage Server.

Overall workflow

Workflow
Figure 1 - Workflow

The first two steps “Web server setup” and “Install the IIPImage Server” are described in detail in chapter 3 and 4 of this guide, but they can be easily executed automatically by running the script “iiif-install.sh” on your computer (find the script in chapter 9).
The step “Convert images to pyramid TIFFs”, described in chapter 5, can be carried out by running the “iiif-image-converter.sh” script (find the script in chapter 9).

2 Prior knowledge and technology

This guide is intended for people with basic prior knowledge of the Linux operating system (e.g. opening the terminal, basic Linux commands (https://opensource.com/article/22/5/essential-linux-commands ), difference between normal and sudo user, etc.). In addition, it would be good if you would familiarize yourself with the following points: IIIF and Image API (https://iiif.io/get-started/how-iiif-works/ ); multi-resolution image file formats (https://iipimage.sourceforge.io/documentation/images/ ).

In-depth technical knowledge is not required, i.e. it is possible to install and set up the Apache and Image Server, perform image format conversion and access the images via a URL by simply following the steps in this guide.

Technology used within the scope of this guide:

  • Operating system: Linux Debian, i.e. Ubuntu

    • sudo user with administration permissions

  • Webserver: Apache2

  • Image server: IIPImage Server

3 Web server setup

Web servers are used to serve web pages requested by client computers. Apache is a widely used web server application. It is very secure, fast and reliable. It makes it possible to share your content (the offline web page) with other users in your network on a real website.

 

Update packages on your computer

Enter the following command in the Linux terminal to install and set up Apache server:

sudo apt-get update

After entering this command, the command line will prompt for user and password.

Figure 2 - Output of the command "sudo apt-get update" 

Install Apache 2 (additionally install sub-software package fcgid)

sudo apt-get install apache2 libapache2-mod-fcgid
Figure 3 - Output of the command "sudo apt-get install apache2 lib-apache2-mod-fcgid" 

Start web server

sudo systemctl start apache2
Figure 4 - Output of the command "sudo systemctl start apache2" 

Make sure that the Apache server is actually running

Open your browser, enter your IP address into your browser’s address bar and the Apache2 Debian Default Page should appear as in the screenshot below.

Figure 5 - Example 'It works!'

Move your content (files you want to access via the browser e.g. html and css files) to the default folder Apache points to (/var/www/html/)

Enter your IP address into your browser and if all goes well, your content will be loaded.

4 Install the IIPImage Server

“The IIPImage Server is a feature-rich high performance image server engineered to be stable, fast and lightweight. It is designed for streaming extremely high resolution images and is capable of handling advanced image features such as 16 and 32 bit per channel depths, floating point data, CIELAB colorimetric images and scientific imagery such as multispectral or hyperspectral images and digital elevation map data.”

IIPImage Server installation and setup is done with the following steps:

Install iipimage-server package with command below

sudo apt-get install iipimage-server

The command will prompt you for installing some dependencies for this package. To do this, type “y” (yes) and press Enter.

Figure 6 - Output of the command "sudo apt-get install iipimage-server" 

Change your image server’s data directory

With the following command the default data directory of your image server /usr/lib/iipimage-server/ is copied to apache2 folder /var/www/:

sudo cp -r /usr/lib/iipimage-server/ /var/www/iipimage-server/
Figure 7 - Output of the command "sudo cp -r /usr/lib/iipimage-server/ /var/www/iipimage-server/"

 

Now you need to run the image server as an Apache module. The modules are configured in directory /etc/Apache2/mods-available/.
Change to this directory and open from there the image server’s iipsrv.conf config file with following command:

sudo nano /etc/apache2/mods-available/iipsrv.conf

In this file change the following line:

ScriptAlias /iipsrv/ "/usr/lib/iipimage-server/"
to
ScriptAlias /iiif "/var/www/iipimage-server/iipsrv.fcgi"

In addition, you can configure the server to serve through a "cleaner" url. You do that by adding this line in the environment variables:

FcgidInitialEnv URI_MAP "iiif=>IIIF"

Save the file with Ctrl+o and press Enter to confirm and close nano with Ctrl+x.
All these changes are illustrated in Figure 8 (red arrows). With this module enabled, Apache knows where you put the image server’s data directory.

Figure 8 - Editing the "iipsrv.conf" file 

Enable the necessary Apache modules for the image server (fcgid already installed and enabled above)

Use the commands:

sudo a2enmod headers