Image Slicer

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://

Run tests:

$ python test

Command-line tools

Two CLI tools are provided: slice-image and 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 --dir or -d tiles will be saved in the same location as the image. The original filename will be used as a prefix unless overridden with --prefix or -p.



$ 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 --dir or -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 --filename or -f.


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 image_03_02.jpg).


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, join_tiles().


Fork the repository on GitHub, commit your changes and send a pull request.


If the following doesn’t help then open an issue.

IOError: decoder %s not available

You are missing some of the libraries required for Pillow. The Pillow documentation will be able to help you. Try starting with the platform-specific instructions.


Just one: Pillow. It will be installed automatically by pip or python

Indices and tables