New package announcement: hmt-image-lib.js
Summary and motivation
hmt-iiif-lib.js
is a javascript library for working with images available from the Homer Multitext project’s IIIF image server, using URN notation. It provides a lightweight, from-scratch IIIF image viewer, along with utility functions for generating IIIF URLs.
The Homer Multitext project (HMT) makes its archive of images available via the IIIF protocol, but its published data releases use CITE2 URNs to provide stable references to images and regions of interest (ROIs) within those images. hmt-iiif-lib.js
simplifies working with this material in a web browser or other javascript environment.
Release notes
Initial release. Main features:
- add a pannable/zoomable image viewer to a web page for an image identified by CITE2. ROIs are visually highlighted.
- overlay multiple ROIs on a single image by invoking the viewer with a list of URNs with differeing ROIs
- “citation mode” allows users to select new ROIs with option-click/drag, and returns CITE2 URNs for all user-selected regions
- compose an IIIF request for an image that can be embedded in a web page
Installation
The file hmt-image.js
can be downloaded from github and used locally, or loaded vis jsDelivr from https://cdn.jsdelivr.net/gh/neelsmith/hmt-image-lib/hmt-iiif-lib.js
.
Documentation
- available on github
Source
- available on github
Caveats
The javascript library and the markdown documentation were written entirely by gemini-2.5-pro. The code passes a series of sanity tests, but I have not even looked at the javascript. When I encountered errors, I let gemini fix them. Use the code as you like, but be aware that I have no idea what it does or how it works.
Auditing the build:
- github repository includes a complete transcript of the chat used to generate the script, with saved intermediate versions of the javascript library. See the repository README for details.