"Resizing" images using IIIF
Without IIIF, resizing an image would require downloading and editing it in a separate software program (e.g. Adobe Photoshop, Canva). However, if IIIF is available and we simply want to display the image on the web, we wouldn't need to create a derivative file. Instead, we can request the size we want using the IIIF Image API, and the image server will respond with the resized image.
The steps for manually requesting a resized image (given the IIIF manifest) are listed below. Although we use Vault as an example, the same instructions will work for any manifest that is backed by a IIIF image server and is level 1 or level 2 compliant (details on levels of Image API compliance).
- Go to the object's manifest page (see detailed instructions for finding a Vault manifest). We'll use this Vault manifest as the example for the rest of this tutorial.
- Scroll through the manifest until you reach the "canvases" section. From here, you'll need to find the canvas that corresponds to the image you're looking for. Depending on the IIIF viewer you're using, it may be faster to search the canvases by title rather than by counting X no. of images from the start.
- From the canvas, follow the manifest down to images, then resource, then service, then the @id attribute. This should look like a URL and contain the unique identifier for this particular image. For our example, this @id is https://vault.library.uvic.ca/images/0a4d3d9f-210a-47be-b89d-a627ea4c570f%252Ffiles%252Fde77c7a9-77fb-4d9e-aa54-87b51b16fd1f. (Note that if you were actually to visit this link in your browser, you would get the info.json response for that image.)
Paste this @id into our browser (but don't hit Enter or visit the link).
- Use the size parameter to change the image's size to what we want. For example, to request the full image at its full/maximum size, we would add "/full/full/0/default.jpg" to the end. So the link to the full image is https://vault.library.uvic.ca/images/0a4d3d9f-210a-47be-b89d-a627ea4c570f%252Ffiles%252Fde77c7a9-77fb-4d9e-aa54-87b51b16fd1f/full/full/0/default.jpg.
As another example, for a thumbnail of the full image that is 150px wide, we would add "/full/150,/0/default.jpg" to the end instead. Some more examples of image requests are below:
/full/,100/0/default.jpg
/full/200,200/0/default.jpg
/full/!300,600/0/default.jpg
The official IIIF documentation contains more visual examples of requests and their results.
"Cropping" images using IIIF
To display a specific part or region of an image without IIIF, we would need to download the full image, crop the image manually, and save a new copy. However, if we want to display the image on the web using IIIF, we can use the Image API to request/display a specific region or area of the image, without needing to save the result as a new image or overwriting the original.
As an example, we'll use the following image of Robin Hopper's nickel glaze tests, which is featured in UVic's Spotlight exhibit, University of Victoria Libraries Publication Series.
- Find the item's manifest page (see detailed instructions for finding a Spotlight manifest).
- Follow steps 2-4 for the previous section above to get the @id attribute of the web service. For our example, this @id is https://exhibits.library.uvic.ca/images/14862-24c186a1fac33deb92d0dbed4239cac4.
- Use the region parameter to specify the region of the image that you want. For example, we could get the first two rows of tiles by appending the following request to the @id attribute:
Note that the region is defined in reference to the full image (2176 px wide by 2906 px high), and not in reference to the size of the image that you're ultimately requesting. The max dimensions of the image are defined in the resource section of a manifest, or in the info.json for an image resource. The IIIF documentation contains a more detailed diagram of how the region is calculated.
Here are 3 more examples of image requests that use the region parameter to "crop" a specific tile:
/1290,2350,400,400
/!200,200/0/default.jpg
/900,1900,400,400
/!200,200/0/default.jpg
/500,1450,400,400
/!200,200/0/default.jpg