Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created April 27, 2011 23:08
Show Gist options
  • Save ejknapp/945437 to your computer and use it in GitHub Desktop.
Save ejknapp/945437 to your computer and use it in GitHub Desktop.
Tiling script for imagemagick
#!/bin/bash
file=$1
function tile() {
convert $file -scale ${s}%x -crop 256x264 \
-set filename:tile "%[fx:page.x/256]_%[fx:page.y/264]" \
+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