Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created October 19, 2011 01:49
Show Gist options
  • Save ejknapp/1297293 to your computer and use it in GitHub Desktop.
Save ejknapp/1297293 to your computer and use it in GitHub Desktop.
Imagemagick script for tiling
#!/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
#s=12.5
#tile
#s=6.25
#tile
#s=3.125
#tile
#s=1.5625
#tile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment