Skip to content

Instantly share code, notes, and snippets.

@xymostech
Created June 24, 2013 19:39
Show Gist options
  • Save xymostech/5852873 to your computer and use it in GitHub Desktop.
Save xymostech/5852873 to your computer and use it in GitHub Desktop.
Download and combine all of the map tiles from the Guild Wars 2 tile API
#!/usr/bin/env bash
for i in {0..127}; do
for j in {0..127}; do
wget -q "https://tiles.guildwars2.com/1/1/7/$i/$j.jpg" -O "$i-$j.jpg" &
done
while [ `jobs | wc -l` -gt 10 ]; do
sleep 1
done
echo "$i"
done
mkdir -p out
for i in {0..127}; do
montage -tile 128x1 -border 0 -geometry +0x+0 {0..127}-$i.jpg out/$i.jpg
echo "$i-$i"
done
# Warning, these require >4GB of memory to run
montage -tile 1x32 -border 0 -geometry +0x+0 out/{0..31}.jpg out/compile0.jpg
echo "compile0"
montage -tile 1x32 -border 0 -geometry +0x+0 out/{32..63}.jpg out/compile1.jpg
echo "compile1"
montage -tile 1x32 -border 0 -geometry +0x+0 out/{64..95}.jpg out/compile2.jpg
echo "compile2"
montage -tile 1x32 -border 0 -geometry +0x+0 out/{96..127}.jpg out/compile3.jpg
echo "compile3"
# Warning, this requires >8GB of memory to run
# montage -tile 1x4 -border 0 -geometry +0x+0 out/compile{0..3}.jpg out/compile.jpg
# echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment