Skip to main content

A python library that loads iiif images (IIIF Image Api Manifests) into a cv2 numpy array

Project description

iiif_image_load

A python library for loading iiif images (IIIF Image Api Manifests).

How to Install

To install, just run pip install iiif_image_load.

About

This library makes it possible to submit the URL to a IIIF Image API manifest (along with optional cropping parameters) and receive a standard OpenCV Numpy (3D BGR) array containing the image.

The downloading process will access image tiles in accordance with the IIIF Image server's specifications. This makes download of image at full resolution possible on all IIIF compliant image servers and will potentially speed up the download process (and relieve stress on the IIIF image server).

Usage

To acquire an image with this library, the following examples should suffice:

from iiif_image_load import iiif_image_from_url
import cv2

img = iiif_image_from_url('https://ids.lib.harvard.edu/ids/iiif/47174896')

cv2.imshow('Demo Paul Gauguin', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

It is also possible to specify a crop box for the image:

from iiif_image_load import iiif_image_from_url
from matplotlib.pyplot import imshow

img = iiif_image_from_url('https://ids.lib.harvard.edu/ids/iiif/47174896', 10, 20, 500, 500)

imshow(img[...,::-1])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iiif-image-load-0.4.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

iiif_image_load-0.4.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file iiif-image-load-0.4.2.tar.gz.

File metadata

  • Download URL: iiif-image-load-0.4.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for iiif-image-load-0.4.2.tar.gz
Algorithm Hash digest
SHA256 8c540632cf9248fe344d93cc57eb98ea5cae0d32097d4ae3291ba4170baeff1f
MD5 50e27a7e9986c6dc8221784229c26876
BLAKE2b-256 147245a6950d3752a826cf2e1eac6e235dc54ef517943dec646f1bafac4d23cd

See more details on using hashes here.

File details

Details for the file iiif_image_load-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: iiif_image_load-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for iiif_image_load-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d3101927729903683260a08d73174bb6145b1cd2338cfabe1f9e1999e9e145
MD5 e63639aa6ce233928b6f57a0d278df46
BLAKE2b-256 d6deae0676236ae634712861f0da078339037f62ef53a6adbfdade41a18032e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page