Skip to content

Tiling an image

Chris Churas edited this page Jun 19, 2017 · 5 revisions

Probability Map Viewer expects an image to be broken into tiles when running in Single image analysis mode. This page provides instructions on two different ways of tiling an image using ImageMagick convert or using chmutil createchmimage.py.

Using chmutil command line tool createchmimage.py

Here is an example on how to tile an image named foo.png via convert command:

createchmimage.py foo.png --gentiles ./tiles --tilesize 128

The above will create a bunch of png files under tiles/ directory named 0-r#_c#.png

To generate tiles of say 256 simply replace 128 in the above with 256

Using ImageMagick command line tool convert

Here is an example on how to tile an image named foo.png via convert command:

mkdir tiles
convert <INPUT IMAGE> -crop 128x128 -set filename:tile "r%[fx:page.y/128]_c%[fx:page.x/128]" +repage +adjoin "tiles/0-%[filename:tile].png"

The above will create a bunch of png files under tiles/ directory named 0-r#_c#.png

To generate tiles of say 256 simply replace 128 in the above with 256