Slice images into tiles and rejoin them. Compatible with Python 2.6+, 3.2+. Relies on Pillow for image manipulation.
To download and install the latest release:
$ pip install image_slicer
Or, for developers, to get the bleeding-edge, unreleased version:
$ pip install -e git://github.com/samdobson/image-slicer.git#egg=image-slicer
$ python setup.py test
Two CLI tools are provided:
join-image. These will be added to your PATH and can thus be called from any directory.
$ slice-image image num_tiles
Unless an output directory is specified with
-d tiles will be saved in the same location as the image. The original filename will be used as a prefix unless overridden with
$ join-tiles tile
Any of the tile images can be used as an argument - the others will be discovered automatically. Unless an output directory is specified with
-d the image will be saved in the same location as the tiles. The prefix of the tiles will be used to save the image unless this is overridden with
See all functions.
Images are always split into exactly equal parts, even if this means creating more than the requested number.
In future versions this behaviour will be overridable.
Tile filenames are appended with a 2-digit representation of the tile’s grid position (e.g
The maximum number of tiles that can be produced is 9800. This is an arbitrary limit which ensures that row and column numbers can be conveniently represented by two digits. Increasing it would break
get_columns_rows() and consequently,
If the following doesn’t help then open an issue.