#!/bin/bash
+# Simple generation of 64x64 tiles
+
for dir in roach
do
mkdir -p ../../images/$dir
inkscape -z -e ../../images/${x%.*}.png -w 64 -h 64 $x
done
done
+
+# Smaller roaches
+
+for size in 32 21
+do
+ mkdir -p ../../images/roach_${size}
+
+ for x in roach/*
+ do
+ xbase=`basename $x`
+ inkscape -z -e ../../images/roach_${size}/${xbase%.*}.png -w ${size} -h ${size} $x
+ done
+done
+
+# Roach quartet
+
+mkdir -p ../../images/roach_quartet
+
+function quartet_tile {
+ for tile in roach eyes
+ do
+ montage ../../images/roach_32/${tile}_${1}.png ../../images/roach_32/${tile}_${2}.png ../../images/roach_32/${tile}_${3}.png ../../images/roach_32/${tile}_${4}.png -geometry -10+0 -background none ../../images/roach_quartet/${tile}_${1}.png
+ done
+}
+
+quartet_tile 1 2 3 4
+quartet_tile 2 3 4 1
+quartet_tile 3 4 1 2
+quartet_tile 4 1 2 3
+
+# Roach nonet
+
+mkdir -p ../../images/roach_nonet
+
+function nonet_tile {
+ for tile in roach eyes
+ do
+ montage ../../images/roach_21/${tile}_${1}.png ../../images/roach_21/${tile}_${2}.png ../../images/roach_21/${tile}_${3}.png ../../images/roach_21/${tile}_${4}.png ../../images/roach_21/${tile}_${1}.png ../../images/roach_21/${tile}_${2}.png ../../images/roach_21/${tile}_${3}.png ../../images/roach_21/${tile}_${4}.png ../../images/roach_21/${tile}_${1}.png -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 ../../images/roach_nonet/${tile}_${1}.png
+ done
+}
+
+nonet_tile 1 2 3 4
+nonet_tile 2 3 4 1
+nonet_tile 3 4 1 2
+nonet_tile 4 1 2 3