I have a 2304 x 3584px image that I want to split up into 126 256x256 tiles.
I figured out how to do this...
convert -crop 256x256 t2_gmd_z8.bmp out2\tile.png
...but I cant figure out how to incorporate the x & y coordinate in the file name.
The big image's top left corner is google coords (121,73) so I want the tiles to be generated as:
tile_121_73.png, tile_122_73.png, .....
I have read the chapter: http://www.imagemagick.org/Usage/crop/#crop_tile
which suggests using fx but I cant get this to work.
Could someone supply me with the command I should use please.
split image into google map tiles
-
- Posts: 16
- Joined: 2012-11-15T06:43:37-07:00
- Authentication code: 6789
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: split image into google map tiles
Windows script; adjust for other shells:
Code: Select all
convert -size 2304x3584 xc:White test.png
convert test.png -crop 256x256 ^
-set filename:tile "%%[fx:page.x/256+121]_%%[fx:page.y/256+73]" ^
+repage +adjoin "tile_%%[filename:tile].png"
snibgo's IM pages: im.snibgo.com
-
- Posts: 16
- Joined: 2012-11-15T06:43:37-07:00
- Authentication code: 6789
Re: split image into google map tiles
Thanks very much.
I guess that the manual has been written for linux users, and for windows we have to double up the percent signs.
I guess that the manual has been written for linux users, and for windows we have to double up the percent signs.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: split image into google map tiles
Yes, among other differences. See http://www.imagemagick.org/Usage/windows/
snibgo's IM pages: im.snibgo.com