smaller roaches aggregated into groups
[koperkapel.git] / sources / vector / generate_bitmaps.sh
1 #!/bin/bash
2
3 # Simple generation of 64x64 tiles
4
5 for dir in roach
6 do
7         mkdir -p ../../images/$dir
8         for x in $dir/*
9         do
10                 inkscape -z -e ../../images/${x%.*}.png -w 64 -h 64 $x
11         done
12 done
13
14 # Smaller roaches
15
16 for size in 32 21
17 do
18         mkdir -p ../../images/roach_${size}
19
20         for x in roach/*
21         do
22                 xbase=`basename $x`
23                 inkscape -z -e ../../images/roach_${size}/${xbase%.*}.png -w ${size} -h ${size} $x
24         done
25 done
26
27 # Roach quartet
28
29 mkdir -p ../../images/roach_quartet
30
31 function quartet_tile {
32         for tile in roach eyes
33         do
34                 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
35         done
36 }
37
38 quartet_tile 1 2 3 4
39 quartet_tile 2 3 4 1
40 quartet_tile 3 4 1 2
41 quartet_tile 4 1 2 3
42
43 # Roach nonet
44
45 mkdir -p ../../images/roach_nonet
46
47 function nonet_tile {
48         for tile in roach eyes
49         do
50                 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
51         done
52 }
53
54 nonet_tile 1 2 3 4
55 nonet_tile 2 3 4 1
56 nonet_tile 3 4 1 2
57 nonet_tile 4 1 2 3