Created
May 1, 2014 19:56
-
-
Save yfujiki/e87881be611931f1d6c9 to your computer and use it in GitHub Desktop.
Create tile images of 256x256, zooming 100%, 50% and 25%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| file=$1 | |
| function tile() { | |
| convert $file -scale ${s}%x -crop 256x256 \ | |
| -set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" \ | |
| +repage +adjoin "${file%.*}_${s}_%[filename:tile].${file#*.}" | |
| } | |
| s=100 | |
| tile | |
| s=50 | |
| tile | |
| s=25 | |
| tile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment