Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created March 8, 2012 01:52
Show Gist options
  • Save ejknapp/1997969 to your computer and use it in GitHub Desktop.
Save ejknapp/1997969 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment