Switch branches/tags
Find file Copy path
22d8799 Apr 16, 2013
74 lines (50 sloc) 2.13 KB

Tile Up

Tile Up is a ruby Ruby gem that splits a large image into a set of tiles to use with javascript mapping libraries such as Leaflet.js or Modest Maps. You can also use Tile Up to make tiles for CATiledLayer (or anything else really...).


gem install tileup

tileup requires rmagick for image manipulation, which depends on imagemagick. imagemagick is avaliable through homebrew.



To generate some tiles from a large image, you'll probably use something like:

tileup --in huge_image.png --output-dir image_tiles \
        --prefix my_tiles --verbose

Which will split huge_image.png up into 256x256 (default) sized tiles, and save them into the directory image_tiles. The images will be saved as my_tiles_[COLUMN]_[ROW].png


Auto zooming

tileup can also scale your image for a number of zoom levels (max 20 levels). This is done by scaling down the original image, so make sure its pretty big.

(Auto zooming is an experimental hack, it should work fine for smaller increments, but may be unreliable at higher levels. E.g. --auto-zoom 4 should work fine, --auto-zoom 20 might not work so well.)

tileup --in really_huge_image.png --auto-zoom 4 \
       --output-dir map_tiles

--auto-zoom 4 means, make 4 levesl of zoom, starting from really_huge_image.png at zoom level 20, then scale that down for 19, etc.

You should see something like:


(where 20 is zoom level 20, the largest zoom, 19 is half the size of 20, 18 is half the size of 19, …)

Getting help

You can get help by running tileup -h.


Fixes and patches welcome, to contribute:

  1. Fork this project
  2. Create a feature or fix branch off the develop branch
  3. Submit a pull request on that branch