Map tiles generator
Go to file
VoidVolker 2e99e6a430 [+] example 2015-08-05 21:45:24 +03:00
LICENSE Initial commit 2015-07-24 19:43:45 +03:00
README.md [+] example 2015-08-05 21:45:24 +03:00
magick-slicer.sh Update magick-slicer.sh 2015-07-31 23:40:14 +03:00

README.md

MagickSlicer

Join the chat at https://gitter.im/VoidVolker/MagickSlicer

DZI and custom map tiles generator.

Dependencies

OS support

  • Linux
  • OSX

Viewers supprot

Usage

magick-slicer.sh [options] [-i] /source/image [[-o] result/dir]
magick-slicer.sh /source/image [options] [result/dir]
magick-slicer.sh /source/image [result/dir] [options]

Use quotes for path or options with spaces. First unknown string interpreting as source image, if it not defined. Second unknown string is interpreting as result path, if it not defined. Also, for source and result you can use options -i and -o. As result you will get sliced image in default format (basic DZI).

Example:

./magick-slicer.sh foo.jpg

Result:

    [file]  foo.dzi
    [dir]   foo_files
    [dir]       0
    [file]          0_0.jpg (1x1px)
                ...
                8
                    0_0.jpg (256x256px)
                ...
                9
                    0_0.jpg
                    0_1.jpg
                    1_0.jpg
                    1_1.jpg
                    ...
                    x_y.jpg
                N

Help options

-?, --help [option]

Show basic help or show help for selected option.

Type: str

-m, --man

Show full help for all options.


Options list

[ -v, --verbose <level> ]

User-selected verbosity levels (0=none, 1=warnings, 2=warnings+info, 3=warning+info+debug) Also, exists short commands for each level: -v0 -v1 -v2 -v3

Default: 0

Type: int

[ -i, --in <file_path> ]

Input file to slice.

Type: str

[ -o, --out <directory_path> ]

Output directory for result.

Default: same as source

Type: str

[ -e, --extension <file_extesion> ]

Set result files extension.

Default: same as source

Type: str

[ -w, --width <tile_width> ]

Set tile width.

Default: 256 pixels or same as height, if height is present.

Type: int

[ -h, --height <tile_height> ]

Set tile height

Default: 256 pixels or same as width, if width is present.

Type: int

[ -s, --step <zoom_step_value> ]

Zoom step value. Formula:

image_size[i+1] = image_size[i] * 100 / step (1)

200 -> 200% or 2x    -> 100% * 100 / 200 = 50%
175 -> 175% or 1.75x -> 100% * 100 / 175 = 57.(142857)%
120 -> 120% or 1.2x  -> 100% * 100 / 120 = 83.(3)%
300 -> 300% or 3x    -> 100% * 100 / 300 = 33.(3)%
100 -> 100% or 1x (no resize) -> infinity loop. Don't use it.

Default: 200

Type: int

[ -p, --options 'imagemagick options string' ]

Specifies additional imagemagick options for convert.

Type: str

[ -g, --gravity <type> ]

Types: NorthWest North NorthEast West Center East SouthWest South SouthEast

The direction you choose specifies where to position image, when it will be sliced. Use -list gravity to get a complete list of -gravity settings available in your ImageMagick installation. http://www.imagemagick.org/script/command-line-options.php#gravity

Default: NorthWest

Type: str

[ -x, --extent ]

Specifies the edge tiles size: cropped or extent them to full size and fill transparent color.

Default: false

Type: logic switch

[ -d, --dzi ]

Specifies output format.

Default: true

Type: logic switch

[ -a, --slicea ]

Type of slicing - slice A. Image scale starts from image size to down. Inverts option --scliceb.

Default: true

Type: logic switch

[ -b, --sliceb ]

Type of slicing - slice B. Image scale starts from tile size and grow up. Inverts option --slicea.

Default: false

Type: logic switch

[ -c, --scaleover ]

Create upscaled image for maximum zoom (last zoom be equal or grater, then image).

zoom[i-1]_size < source_image_size < zoom[i]_size

zoom[i]_size - this is upscaled image.

Work only in slice B mode. In other cases ignored.

Default: false

Type: logic switch

[ -r, --horizontal ]

Tiles divide image on horizontal side without remains. On this side tiles will not be croped.

Work only in slice B mode. In other cases ignored.

 ___ ___ ___  _ _
|   |   |   |  ^
|___|___|___|  Image
|___|___|___| _v_   <- Not full tiles.
|_._|_._|_._| <-- Transparent color (extent=true) or cropped (extent=false)

Default: true

Type: logic switch

[ -t, --vertical ]

Tiles divide image on vertical side without remains. On this side tiles will not be croped.

Work only in slice B mode. In other cases ignored.

|<-image->|
 ___ ___ _ _  _ _
|   |   | |.|  ^
|___|___|_|_| _v_Tile
|   |   | |.|
|___|___|_|_|
           ^-- Transparent color (extent=true) or cropped (extent=false)
         ^--- Not full tiles

Default: false

Type: logic switch