Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save andrewmarmion/df2118cc4d1284e367d57188761d3ad5 to your computer and use it in GitHub Desktop.

Select an option

Save andrewmarmion/df2118cc4d1284e367d57188761d3ad5 to your computer and use it in GitHub Desktop.
Using ImageMagick to create tiles for an image
convert myImage.jpg -crop 256x256 \
-set filename:tile "%[fx:page.x/256]-%[fx:page.y/256]" \
+repage +adjoin "Tile-%[filename:tile].png"
// converts an image into 256 tiles with the files named as Tile-row_num-column_num.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment