Created
November 16, 2014 22:05
-
-
Save sanderversluys/9659efc826f07795c3f8 to your computer and use it in GitHub Desktop.
Split image in tiles with ImageMagick
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