Skip to main content

Write iiif-image tiles using ImageMagick

Project description

magick_tile

PyPi version

This python script relies on Imagemagick to efficiently create derivative tiles of a very large image, and structure them into directories compliant with IIIF Level 0 specification for static sites.

This takes inspiration heavily from https://github.com/zimeon/iiif/blob/master/iiif_static.py, but uses ImageMagick rather than Pillow in order to speed up generation at the expense of a less flexible treatment of images.

Prerequisites

Run

python3 magick_tile.py --help

> Usage: magick_tile.py [options] file (-h for help)
>
> IIIF Image API Level-0 static file generator
>
> Options:
>   -h, --help            show this help message and exit
>   -o OUTPUT, --output=OUTPUT
>                         Destination directory for tiles
>   -i IDENTIFIER, --identifier=IDENTIFIER
>                         Image identifier to be written to final info.json
>                         (e.g. https://example.com/iiif/my_image)
>   -t TILESIZE, --tilesize=TILESIZE
>                         Tile size to produce [default 256]

python3 magick_tile.py -o apple/ -i "https://example.com/iiif/apple" apple.jpg

This will create and populate the specified output directory with tiles from a given image.

N.b. because several of the Imagemagick utilities called here already utilize multiple cores, returns for running this script in parallel diminish rapidly.


Matthew Lincoln

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

magick_tile-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file magick_tile-0.0.2.tar.gz.

File metadata

  • Download URL: magick_tile-0.0.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for magick_tile-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8e379434e097e02f1a019577e7987036512f848c7d648357a7ea3213c15687ae
MD5 b531e8b34d2e8e020dc14fe079f423ad
BLAKE2b-256 07d5aff535dbe646385f72fa446c62d6e4c7c14c41ef2317fd8c43870026d67c

See more details on using hashes here.

Supported by

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