Introduction to Open Data
  • Home
  • Syllabus
  • Exercises
    • Exercise 1: OA Deep Dive
    • Exercise 2: Movements and Principles
    • Exercise 3: Up to date with Linked Data
    • Exercise 4: Discovering ORD Platforms
    • Exercise 5: The Reuser’s Perspective (OGD)
    • Exercise 6: Reading Assignment
    • Exercise 7: Open Refine
    • Exercise 8: IIIF & ML
  • Course Sections
    • Characteristics of Open Data
    • Associated Movements
    • Associated Principles
    • Open Data Platforms and Organisations
    • Assessment, Data Quality, and Best Practices
    • Techniques, Software, and Tools
    • Showcases
  • Recap
  • References
  • About

On this page

  • IIIF & ML
    • A. Finding and Comparing IIIF Resources
    • B. IIIF Image API — URI Manipulation
    • C. Exploring a Manifest as JSON-LD
    • D. Building a IIIF Collection on Biblissima
    • E. Creative Reuse: IIIF Collage Demo
    • F. ML-Powered Analysis: Illustration Detector
    • G. Reflection
    • Bonus: Run Your Own Local IIIF Server
  • Additional Resources
  • Edit this page
  • Report an issue

Exercise 8: IIIF & ML

Author
Affiliations

Julien A. Raemy

docuteam SA

University of Bern

Published

February 24, 2026

Modified

March 11, 2026

IIIF & ML

NoteInstructions

This exercise covers IIIF (International Image Interoperability Framework) from the ground up — finding and comparing resources, manipulating Image API URIs, reading a manifest as JSON-LD, and building a collection — before moving on to Machine Learning applications. Work alone or in pairs.

A. Finding and Comparing IIIF Resources

  1. Open the Mirador demo viewer at https://projectmirador.org/demo/, close the default examples, and open at least two versions of the Gutenberg Bible by pasting these manifest URLs:

    Institution Manifest URL
    Bayerische Staatsbibliothek (BSB) https://api.digitale-sammlungen.de/iiif/presentation/v2/bsb00004647/manifest
    Bibliothèque Mazarine https://mazarinum.bibliotheque-mazarine.fr/iiif/1703/manifest
  2. Find a third Gutenberg Bible (or fragment) on one of the following portals and open its manifest in Mirador:

    • Digital Bodleian (University of Oxford): https://digital.bodleian.ox.ac.uk/
    • Gallica (BnF): https://gallica.bnf.fr/
    • DigiVatlib (Vatican): https://digi.vatlib.it/
TipHints for Part A
  • To open a manifest in Mirador, click the + (Add resource) button and paste the manifest URL.
  • On Gallica, search for “Gutenberg” and look for the IIIF logo on the item page or open Mirador to find it. Alternatively, you can use the detektIIIF browser extension to surface manifests automatically as you browse. This plug-in works for Firefox and Google Chrome.

B. IIIF Image API — URI Manipulation

The images below are served from two different institutions using the same IIIF Image API standard. Notice the structural similarity of the URLs despite the different servers and collections (both return 600px wide images via the 600, size parameter):

  • https://api.digitale-sammlungen.de/iiif/image/v2/bsb00004647_00005/full/600,/0/default.jpg
  • https://e-codices.ch/loris/fmb/fmb-cb-0600a/fmb-cb-0600a_004.jp2/full/600,/0/default.jpg
Gutenberg Bible page, Bayerische Staatsbibliothek
Biblia. [1], Genesis-Psalmi — Bayerische Staatsbibliothek (BSB), Munich
…/bsb00004647_00005/full/600,/0/default.jpg
Cologny, Fondation Martin Bodmer, Cod. Bodmer 600/1 (e-codices)
Cologny, Fondation Martin Bodmer, Cod. Bodmer 600/1. The Life of Buddha, first book (Shaka no Honji, jō). e-codices
…/fmb-cb-0600a/fmb-cb-0600a_004.jp2/full/600,/0/default.jpg
TipIIIF Image API — URI Syntax and Version Differences

The URI follows this pattern: {server}/{identifier}/{region}/{size}/{rotation}/{quality}.{format}

The key differences between the two current versions:

Parameter IIIF Image API 2.1 IIIF Image API 3.0
Full image (no downscaling) full max
Upscaling beyond native size not supported ^w, or ^!w,h
Quality: server default native (deprecated) → default default
@context …/image/2/context.json …/image/3/context.json

In practice, many servers still accept full for backwards compatibility, but max is the correct term in 3.0. The region, rotation, quality, and format parameters are otherwise identical between versions.

  1. Start from this Image API URI for a BSB page and open it in your browser:

https://api.digitale-sammlungen.de/iiif/image/v2/bsb00004647_00005/full/full/0/default.jpg

Use the IIIF Image Inspector at https://iiifimage.link/ to manipulate the URI parameters. Try to produce at least two of the following variations:

  • A cropped region (e.g. the top-left quarter of the page)
  • A specific pixel width (e.g. 200,)
  • A 90° or 180° rotation
  • A greyscale or bitonal rendering
  1. The BSB server only supports Image API 2. To explore API 3, use this image from the PTT Archive instead — check its info.json first:

https://iiif.ptt-archiv.ch/iiif/3/P-38-2-1851-08.jp2/info.json

Construct a valid IIIF Image API 3 URI that returns the full image at maximum size.

TipHints for Part B
  • In the Inspector, change one parameter at a time and observe how the image updates — this is the easiest way to build intuition.
  • The region parameter uses pixel coordinates: x,y,w,h. To crop the top-left quarter of an image that is 2000 × 2800 px, you would use 0,0,1000,1400.
  • For step 5: the base URI structure is {base}/{region}/{size}/{rotation}/{quality}.{format}. In API 3, full (meaning “as large as possible”) was renamed to max. So the URI becomes: https://iiif.ptt-archiv.ch/iiif/3/P-38-2-1851-08.jp2/full/max/0/default.jpg
  • Additional tools: IIIF Cropping Tool (2.1 only, focused on the region parameter).

C. Exploring a Manifest as JSON-LD

  1. Open the Fragmentarium manifest in your browser:

https://fragmentarium.ms/metadata/iiif/F-65po/manifest.json

TipIIIF Presentation API — Version Differences

The Fragmentarium manifest uses Presentation API 2.1. Many newer institutions publish in 3.0. The main structural differences:

Aspect IIIF Presentation API 2.1 IIIF Presentation API 3.0
JSON-LD keywords @id, @type id, type
Type values sc:Manifest, sc:Canvas Manifest, Canvas
Image path sequences[0] → canvases → images → resource → @id items → items (AnnotationPage) → items (Annotation) → body → id
Descriptive text label (string), description label (language map {"en": ["…"]}), summary
Rights / attribution license, attribution rights, requiredStatement
@context …/presentation/2/context.json …/presentation/3/context.json
  1. Navigate the v2.1 JSON structure to find:

    • The manifest label
    • The image URI at: sequences → canvases → images → resource → @id
    • The info.json base URI at: resource → service → @id
  2. Open it (normally the URL redirects to the /info.json; if not, you need to append it). What information does it provide about the image, such as dimensions, available sizes and API compliance level?

TipHints for Part C
  • If the raw JSON is hard to read in a browser, paste the URL into https://jsonhero.io/ for an interactive tree view.
  • In the v2.1 manifest, sequences[0].canvases[0].images[0].resource["@id"] gives you the full Image API URI (ending in /full/full/0/default.jpg). Paste it into your browser to display the image directly.
  • The service["@id"] inside resource is the Image API base URI and should redirect to the /info.json.

D. Building a IIIF Collection on Biblissima

  1. Go to https://iiif.biblissima.fr/collections/ and create a new IIIF Collection by adding a few digital objects to your basket 🛒.

  2. View your newly created collection in Mirador.

  3. Open the raw JSON of your collection. How does a collection reference its member manifests?

TipHints for Part D
  • On Biblissima, you do not need an account — you can build and share a collection directly. Copy the collection URL once you have added your items.
  • In the collection JSON, the top-level type is sc:Collection (Presentation API 2) or Collection (Presentation API 3). Member manifests appear in the members array (v2) or items array (v3).
  • A IIIF Collection is itself a valid IIIF resource: you can nest collections inside other collections, enabling hierarchical structures for large corpora.

E. Creative Reuse: IIIF Collage Demo

The IIIF Collage Demo assembles images from IIIF manifests into generative visual collages.

  1. Generate a collage by clicking on the dice icon 🎲. This will randomly select a manifest and look for fragments.

  2. Once you see the fragments, you can start your collage. Save it as a PNG or view it as a new manifest.

TipHints for Part E
  • If the Space is slow to respond, it may be waking up from idle — wait a moment and retry.
  • The collage is built from the canvases in the manifest: the more pages, the richer the result.

F. ML-Powered Analysis: Illustration Detector

The IIIF Illustration Detector uses a small object-detection model to localise illustrations, miniatures, and decorations within digitised pages.

  1. Open the demo, select a sample manifest from the drop-down list and load it.

  2. Classify with a low (<50%) and high confidence threshold (>90%) and export the annotations. Have a look at the JSON-LD file.

TipHints for Part F
  • The model outputs bounding boxes with confidence scores. Low-confidence detections may indicate ambiguous content (decorative initials, ruled borders).
  • Dense text columns or marginal annotations can sometimes trigger detections — think about why a model trained on visual regions might confuse them with illustrations.
  • Consider the downstream value: how could automated illustration detection at scale help cataloguers, researchers, or discovery interfaces?

G. Reflection

  1. What advantages do the IIIF specifications offer when building ML pipelines across multiple cultural heritage institutions?

  2. How might the outputs of a tool like the Illustration Detector be published as structured open data alongside the source IIIF manifest?

TipHints for Part G
  • Q15: Think about interoperability — IIIF means a pipeline written once can consume images from the BSB, the BnF, or e-codices without institution-specific code. What does that enable at scale?
  • Q16: Detected regions can be encoded as W3C Web Annotations and attached to IIIF canvases via the annotations property. Have a look at the IIIF Cookbook for annotation examples.

Bonus: Run Your Own Local IIIF Server

tiny-iiif is a lightweight, Docker-based tool for hosting your own IIIF Image API server and generating IIIF Presentation API 3.0 manifests automatically from uploaded images.

  1. Get the repository — clone it or download the ZIP:

    git clone https://github.com/rsimon/tiny-iiif.git
    cd tiny-iiif
  2. Configure — copy the example environment file:

    cp .env.example .env

    Default credentials: tiny / tiny. IIPImage is used by default; Cantaloupe is available via COMPOSE_PROFILE=cantaloupe in .env.

  3. Start the server:

    docker compose up --build
  4. Open the admin interface at http://localhost/tiny, log in, and upload a few images via drag-and-drop — they are automatically converted to pyramidal TIFFs. Create a folder, add your images, and inspect the auto-generated manifest.

  5. Open the manifest in Mirador (https://projectmirador.org/demo/) or Universal Viewer (https://www.universalviewer.dev/). As an extension: can you run the Illustration Detector (Part F) on the manifest your local server just generated?

TipHints for the Bonus
  • You will need Docker Desktop (macOS/Windows) or Docker Engine + Compose (Linux) installed and running before you start.
  • To stop the server cleanly: docker compose down
  • The local manifest URL will follow the pattern http://localhost/manifests/... — paste it directly into any IIIF clients.

Additional Resources

  • IIIF Image API 2.1 URI syntax: https://iiif.io/api/image/2.1/#uri-syntax
  • IIIF Image API 3.0 URI syntax: https://iiif.io/api/image/3.0/#2-uri-syntax
  • IIIF Presentation API 2.1: https://iiif.io/api/presentation/2.1/
  • IIIF Presentation API 3.0: https://iiif.io/api/presentation/3/
  • Guides to finding IIIF resources: https://iiif.io/guides/finding_resources/
  • IIIF Cookbook: https://iiif.io/api/cookbook/
  • IIIF Community groups: https://iiif.io/community/groups/
  • Hugging Face GLAM ML models: https://huggingface.co/spaces/small-models-for-glam
  • tiny-iiif on GitHub: https://github.com/rsimon/tiny-iiif
Back to top

Reuse

CC BY 4.0

Julien A. Raemy | Introduction to Open Data

 
  • Edit this page
  • Report an issue

Content is published under a Creative Commons Attribution 4.0 International licence