GithubHelp home page GithubHelp logo

web5design / tileup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rktjmp/tileup

0.0 1.0 0.0 108 KB

Ruby gem to convert large images into tiles to use with js mapping libraries

License: MIT License

tileup's Introduction

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

Installation

gem install tileup

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

Usage

Basics

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

image_tiles/my_tiles_0_0.png
image_tiles/my_tiles_0_1.png
image_tiles/my_tiles_0_2.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:

map_tiles/20/map_tile_0_0.png
map_tiles/20/map_tile_0_1.png
map_tiles/20/map_tile_0_2.png
...
map_tiles/19/map_tile_0_0.png
map_tiles/19/map_tile_0_1.png
map_tiles/19/map_tile_0_2.png
...

(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.

Contributing

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

tileup's People

Contributors

trey-jones avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.