Friday, August 10, 2012

ImageMagick: multi tile an image with command line tools (i.e. beating a dead horse)

Make this:

Into this:


without any number of gui tools that can do the exact same thing!

download / install imagemagick onto your favorite linux distro (sorry didn't make the script for windows)

copy/paste this script into a file called tile_image.sh


#!/bin/bash
infile=$1
size="800x800"
resize="50%"
tmpfile=$(mktemp -u)


convert -resize ${resize} $infile ${tmpfile} 
convert ${tmpfile} -clone 0 +append -write mpr:sometile +delete -size ${size} tile:mpr:sometile output.png
rm -f ${tmpfile}


Then run the following commands to make the script executable and run it on the image of your choosing.

chmod +x tile_image.sh
./tile_image.sh ~/dead_horse.png 



Happy tiling (not that it serves any meaningful purpose :-P

./Steven

No comments:

Post a Comment