# ๐ Week 8 โ Image Objects 2 ### APIs & IIIF (International Image Interoperability Framework) --- ### ๐ง Agenda 1. Quick Review โ Images & Compression 2. What Is an API? Examples & Parameters 3. IIIF Overview โ Architecture & Use Cases 4. Hands-on Exploration & Discussion --- ## ๐ผ๏ธ Bitmap vs Vector Graphics | | Bitmap (Raster) | Vector | |--|--|--| | Composition | grid of pixels | mathematical paths (lines, curves) | | Scaling | loses quality when enlarged | infinitely scalable | | Common Formats | JPEG, PNG, TIFF | SVG, EPS, PDF | | Typical Uses | photographs, scans | logos, diagrams, illustrations | --- ## ๐๏ธ Compression - **Compression = reduce file size** - **Lossy (e.g., JPEG)** โ discards data, smaller file, some quality loss - **Lossless (e.g., PNG, TIFF)** โ keeps all data, larger file, archival quality --- ### ๐ APIs โ Quick Definition **API = Application Programming Interface** โ rules for how software communicates and exchanges data > ๐งฉ Think of an API as a menu: you request a dish (endpoint + parameters) and the server returns data (the response). Most web APIs return structured data (JSON or XML). --- ## ๐ Try These in Your Browser ### Wikipedia Summary API [`https://en.wikipedia.org/api/rest_v1/page/summary/Albert_Camus`](https://en.wikipedia.org/api/rest_v1/page/summary/Albert_Camus) ### Open-Meteo Weather API [`https://api.open-meteo.com/v1/forecast?latitude=39.1653&longitude=-86.5264&hourly=temperature_2m`](https://api.open-meteo.com/v1/forecast?latitude=39.1653&longitude=-86.5264&hourly=temperature_2m) ### Library of Congress Collections API [`https://www.loc.gov/collections/?q=comic+books&fo=json`](https://www.loc.gov/collections/?q=comic+books&fo=json) > ๐ง **Activity:** Change a parameter (e.g., article title, latitude, `fo=xml`) and see how the output changes. --- ## ๐งฉ APIs in Digital Libraries - Reuse data in different applications - Build dynamic search and browse tools - Enable interoperability across institutions โก๏ธ **IIIF** is a specialized API for images that follows these same principles. --- # ๐ผ๏ธ IIIF Overview International Image Interoperability Framework > A set of open standards that enable image sharing and deep zoom across platforms. ### Goals - Consistent image delivery and metadata - Interoperability between institutions - Reusable manifests and image services --- ## โ๏ธ IIIF Architecture (Simplified) ``` +-----------------------------+ | IIIF-Compatible Viewer | | (UniversalViewer, Mirador) | +-------------+---------------+ | v +-----------+--------------+ | Presentation API | | (Manifests & Metadata) | +-----------+--------------+ | v +-----------+-----------+ | Image API | | (Cantaloupe Server) | +-----------+-----------+ | v Image Storage (TIFF, JPEG2000, etc.) ``` ๐ Reference: [IIIF Technical Overview](https://iiif.io/api/annex/notes/technical-overview/) --- ### ๐งญ IIIF Components | Component | Purpose | |------------|----------| | **Image API** | Delivers images and tiles; supports parameters for region/size/rotation | | **Presentation API** | Describes the structure of digital objects (manifests, canvases) | | **Viewer (Client)** | Displays IIIF resources using APIs (e.g., Universal Viewer, Mirador) | | *(Optional)* Annotation / Search APIs | Link transcriptions or enable text search | --- ## ๐งช Try It โ IIIF Viewers - **Universal Viewer:** [https://universalviewer.io/](https://universalviewer.io/) - **E-Codices Example:** [https://www.e-codices.unifr.ch/en/list/one/csg/1092](https://www.e-codices.unifr.ch/en/list/one/csg/1092) - **IU Digital Collections:** [https://digitalcollections.iu.edu/collections/2801pg36g](https://digitalcollections.iu.edu/collections/2801pg36g) - **Lugar Papers:** [https://collections.libraries.indiana.edu/lugar/](https://collections.libraries.indiana.edu/lugar/) > ๐งฉ **Group Task:** Find a manifest (URL ending in `/manifest`) and load it into Universal Viewer. --- ### ๐งฎ IIIF Image API URL Structure ``` {scheme}://{server}/{prefix}/{identifier}/{region}/{size}/{rotation}/{quality}.{format} ``` **Example:**
| Segment | Meaning | |----------|----------| | `region` | portion of image (full | x,y,w,h) | | `size` | max | pct:n | w,h | | `rotation` | degrees (0โ360) | | `quality` | default, gray, color, bitonal | | `format` | jpg, png, tif | --- ### ๐ง Mini Lab โ Manipulate a IIIF URL Try these variations in your browser: ``` # Resize .../full/800,/0/default.jpg # Crop .../0,0,600,600/max/0/default.jpg # Grayscale .../full/max/0/gray.jpg ``` > ๐ **Goal:** See how changing parameters changes the returned image. --- ## ๐ฌ Discussion & Wrap-Up **Reflect:** 1. How are IIIF URLs similar to other APIs you tested? 2. What does IIIF add beyond basic image delivery? 3. How could you use IIIF in your final project? --- ### ๐ Resources & References - [IIIF Wikipedia](https://en.wikipedia.org/wiki/International_Image_Interoperability_Framework) - [IIIF.io Technical Overview](https://iiif.io/api/annex/notes/technical-overview/) - [Universal Viewer](https://github.com/UniversalViewer/universalviewer) - [Owen Stephens โ Intro to APIs Using IIIF](http://www.meanboyfriend.com/overdue_ideas/2016/06/introduction-to-apis-using-iiif/) - [Sheila Rabun Video: *What Is IIIF?*](https://youtu.be/8LiNbf4ELZM) --- # โ Takeaways - APIs = structured data access via URLs and parameters. - IIIF = API standard for images and metadata interoperability. - You can manipulate IIIF image URLs just like other API requests. - Next week โ OCR & text extraction (bridging images and text).