Skip to content

Usage example for the custom YAML dezoomer

Ophir LOJKINE edited this page Jan 25, 2021 · 21 revisions

This page describes how to use the tool, following a concrete example.

Stage 1: Find the meta-information associated to your zoomable image

Here is the information we need to find:

  • the high-resolution image dimensions (width and height in pixels)
  • the dimensions of the small image tiles (width and height in pixels)

There are several methods for this, depending on the zoomable image service. For the image size, you can try to look for it in the image source, in the resources the page loads, or try to guess, starting with a small value. For the tile sizes, you can use your browser's network monitor to find the tiles, and check their size.

Stage 2: construct the URL template

Here, you need to find the URL format for the tiles. You have to locate the tiles in the network monitor, and copy their URLs. You will probably find out that all tiles have similar URLs, with only a few parameters that change. You will need to guess which parameters represent the x and y position of the tile.

For instance, if our tiles have the following URLs :

and the URL template to use is{{x}}/{{y}}.jpg

Stage 3: create a tiles.yaml file

Open a new blank plain text file in a text editor. You can use Notepad on Windows, TextEdit on MacOS, or Gedit on Linux.

We start by copy-pasting the example tiles.yaml file, and then we modify it:

  • We set url_template to the url pattern we found in step 2
  • We set the variables according to what we got in step 1
  • We set Referer to the URL of the initial web page on which we found the zoomable image.
  • If we don't have an x and y variables, we use x_template and y_template to specify how to compute the x and y position of each tile.

Then save the file with the name tiles.yaml. Make sure you save it as tiles.yaml and not tiles.yaml.txt. Some text editors tend to add a .txt extension to text files. For instance, in Notepad, you have to select All files (*.*) under Save as type.

How to fill the variable fields

  1. For each variable, dezoomify-rs will generate all of its possible values, going from the indicated from value to the to value, incrementing it by step every time.
  • For instance { name: x, from: 0, to: 3, step: 1 } will generate the values x=0, x=1, x=2, and x=3,
  • and { name: x, from: 1, to: 20, step: 5 } will generate the values x=1, x=6, x=11, and x=16.
  1. For each possible combination of variable values, it will create a tile by interpreting the value of the url_template field and downloading an image from it.
  2. Then, it will paste the tile at the value indicated by the x_template and y_template fields. The default value of the x_template field is the variable x, and the default value of the y_template field is the variable y.


Tile number by axis in the URL

url_template: "{{x}}/{{y}}.jpg"
x_template: "x * tile_size"
y_template: "y * tile_size"
  - { name: x, from: 0, to: 2 } # Number of tiles on the x axis
  - { name: y, from: 0, to: 3 } # Number of tiles on the y axis
  - { name: tile_size, value: 256 }
  Referer: ""

Generated tile URLs

Tile coordinates in pixels in the URL

url_template: "{{x}}&y={{y}}"
  - { name: x, from: 0, to: 512, step: 256 } # Image width, in pixels
  - { name: y, from: 0, to: 768, step: 256 } # Image height, in pixels

Generated tile URLs

Tile index in the url

url_template: "{{i}}.jpg"
x_template: "i % horizontal_tiles"
y_template: "i / horizontal_tiles"
  - { name: i, from: 0, to: 11 } # Total number of tiles
  - { name: horizontal_tiles, value: 60 } # Number of tiles on the x axis

Generated tile URLs

Stage 4: launch dezoomify-rs

Open a terminal and launch:

dezoomify-rs tiles.yaml result.jpg


  • dezoomify-rs is the path to which you downloaded the executable file for your platform,
  • tiles.yaml is the path to which you saved the file created in the previous step.
  • result.jpg is the path to the image file you want to create.

Then just wait for the program to finish (this can take some time if the number of tiles to download is large), and open result.jpg: your image should be there !


VirtualBox_MSEdge - Win10_28_09_2020_09_20_46 VirtualBox_MSEdge - Win10_28_09_2020_09_22_46 VirtualBox_MSEdge - Win10_28_09_2020_09_23_08 VirtualBox_MSEdge - Win10_28_09_2020_09_23_20 VirtualBox_MSEdge - Win10_28_09_2020_09_23_48 VirtualBox_MSEdge - Win10_28_09_2020_09_24_30