Learning the IIIF Image Api
Many ways to get images on IIIF Server
There are a lots of ways to experiment with the IIIF Image API, depending on your interest level.
- You can play around with and manipulate images already existing on a IIIF image server.
- Archive.org
- See: https://medium.com/@aeschylus/use-internet-archives-iiif-endpoint-to-unlock-your-images-potential-9b0a3efa5b55
- Search for an image on https://archive.org
- Find the image id
- Add the id into this url https://iiif.archivelab.org/iiif/
/full/full/0/default.jpg - for example:
- https://iiif.archivelab.org/iiif/mma_guitar_503440/info.json
- https://iiif.archivelab.org/iiif/mma_guitar_503440//full/100,/0/default.jpg
- You can create an account at IIIF Hosting, and upload your own images.
- You can install an image server locally and load in your own images.
- We will try to do this together. See below.
Installing a IIIF Server Locally
Download Cantaloupe
For more information, checkout the Cantaloupe getting started guide.
Go to your downloads folders
Unzip the download and place the contents of that folder in our WorkshopDir
folder.
$ unzip cantaloupe-4.1.1.zip
Now move the extracted folder to our WorkshopDir
$ mv cantaloupe-4.1.1 ~/Your/Path/To/WorkshopDir
Now navigate to that WorkshopDir
Using the alias we set up, e.g. $ workshop
or with your full path, e.g. $ cd ~/Your/Path/To/WorkshopDir
List all the files in this directory
$ ls
And you should see cantaloupe-4.1.1
Configure Cantaloupe
Navigate into cantaloupe-4.1.1
$ cd cantaloupe-4.1.1
Create a copy of the sample configuration file
$ cp cantaloupe.properties.sample cantaloupe.properties
And open the file cantaloupe.properties
in your favorite text editor.
If you're using atom
and have installed the command line tools, you can type:
$ atom cantaloupe.properties
Now lets enable the admin panel where we will modify the rest of the settings.
Scroll to line 105, and change false to true. Also add a password/secret.
- admin.enabled = false
+ admin.enabled = true
- admin.secret =
+ admin.secret = yolo
We need to make one more change here.
Scroll to line 297 and change AutomaticSelectionStrategy
to ManualSelectionStrategy
# * If set to `ManualSelectionStrategy`, a processor will be chosen based
# on the rest of the keys in this section.
- processor.selection_strategy = AutomaticSelectionStrategy
+ processor.selection_strategy = ManualSelectionStrategy
Save the file.
Run Cantaloupe
Now, start Cantaloupe
$ java -Dcantaloupe.config=./cantaloupe.properties -Xmx2g -jar Cantaloupe-4.1.1.war
Now let's go here:
Now navigate to http://127.0.0.1:8182/iiif/2 in your browser.
Hopefully you see:
Add Some Images to Cantaloupe
Now let's add some images.
First lets create a separate image directory.
Navigate to our WorkshopDir
using our alias $ workshop
or with your full path, e.g. $ cd ~/Your/Path/To/WorkshopDir
Create a new directory called images
$ mkdir images
Add some images.
Create at least one image called demo.jpg
Now, enter the admin panel by navigating to http://127.0.0.1:8182/admin.
Use the username admin and the password you set previously.
Click on Source (in the left hand panel)
Click on FilesystemSource (in the lower panel)
Change the Path Prefix to ../images/
Starting Using your IIIF accessible images
View the full image
Checkout http://127.0.0.1:8182/iiif/2/demo.jpg/full/full/0/default.jpg
Now let's play around with the image parameters, experiencing the kinds of image transformations that are possible using the url parameters described in the API documentation.
Consult the IIIF Image API and start manipulating your image using the URI syntax
- turn the image upside down
- turn it 90 degrees to either side
- request a thumbnail
- request a bitonal copy
- request a region of the image
You can also try experimenting with the IIIF Playground https://www.learniiif.org/image-api/playground
Inspect the info.json file
Checkout http://127.0.0.1:8182/iiif/2/demo.jpg/info.json
This metadata, corresponds to the rules laid out in the IIIF Image API.
Viewers use this information to optimize performance.
View your image in a IIIF Viewer
Let's quickly view it in a viewer.