CommandSyntax

inductiveload Martin Valgur forquest

Mandatory parameters

The image locations are given with the first positional parameter. In its raw state, this is the URL of a page ''containing'' the Zoomify object, for example http://www.bl.uk/onlinegallery/onlineex/evancoll/a/zoomify72459.html

The output image is given by the second positional parameter. This should be a file on your local filesystem, for example foo.jpg or /tmp/foo.jpg.

Optional parameters

If you set the -b flag, the script will take the first positional parameter as the raw base directory of the Zoomify file structure. In this case it would be: -b http://ogimages.bl.uk/images/zoomify/014/014EVA000000000U05043000. There is no slash at the end of the URL.

If you set the -l flag, the script takes as an input a local file containing a list of URLs, one on each line. Each of these is interpreted as before (you can give a simple page URL or a base URL with the -b parameter). You can follow the URL with the local filename you want to save as, separated by a tab (Tabulator) character: http://foo.com/zoomify/1 bar.jpg

You can set the zoom level with the -z parameter. Zoom level 0 is the most zoomed-out, and the highest zoom level (most zoomed-in) depends on the particular image. Default behaviour is to use the highest available zoom level. Negative zoom levels can also be used: zoom level -1 corresponds to the most zoomed in level, -2 to half the (edge) size of that, -3 to 1/4 the size, -4 to 1/8, etc.

Increase the level of output verbosity (default is "warning") with -v ("info") or -vv ("debug").

Tile handling

The -s parameter will save the individual tiles into the folder equal to the output filename, minus the extension. For example, the tiles for C:\foo.jpg will be stored in C:\foo\.

The -x parameter will no download new tiles, it will use tiles downloaded previously and saved with the -s flag. This is useful if the image stitching fails for some reason.

Dependency handling

If you wish to use a jpegtran binary other than that provided, use the -j parameter to give the path of the executable, for example -j /usr/local/bin/jpegtran

Task administration

You can change the number of parallel download connections with -t. The default number is 16.

Examples

You run the script by writing a command like the examples below into the Windows or Linux (or whatever) command line, and not into the Python interactive prompt. If your prompt begins ">>>", you are already in Python, and need to exit. Also ensure you are using Python 3. Enter python -V to check. On Linux you can also execute the program directly ("./dezoomify.py <params>"), provided that Python 3 is installed.

  • To download an image from a page containing a Zoomify object:

    • python dezoomify.py http://www.bl.uk/onlinegallery/onlineex/evancoll/a/zoomify72459.html output.jpg
  • To download from the base URL:

    • python dezoomify.py http://fotothek.slub-dresden.de/zooms/df/dk/0001000/df_dk_0001708 output.jpg -b
  • To download from pages containing Zoomify objects, but using a list of page URLs:

    • python dezoomify.py c:\list.txt output.jpg -l
  • To download from pages containing Zoomify objects, but using a list of base URLs:

    • python dezoomify.py c:\list.txt output.jpg -l -b
  • To get the image at a different zoom level (0 is lowest, highest depends on the image), add -z <level> e.g. -z 3:

    • python dezoomify.py http://www.bl.uk/onlinegallery/onlineex/evancoll/a/zoomify72459.html output.jpg -z 3
  • To save the tiles as they are downloaded (in the same directory as the output), add -s:

    • python dezoomify.py http://www.bl.uk/onlinegallery/onlineex/evancoll/a/zoomify72459.html output.jpg -s
  • To re-stitch the image from the tiles downloaded with -s, use -x:
    • python dezoomify.py http://www.bl.uk/onlinegallery/onlineex/evancoll/a/zoomify72459.html output.jpg -x

Related

Wiki: Home