From: Matteo Nastasi Date: Thu, 30 Apr 2020 06:48:33 +0000 (+0200) Subject: tools to create bordered cards in a sprite X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=1c78f5fe00ac6ebdc24a507357fa9295b54ed515;p=brisk-img.git tools to create bordered cards in a sprite --- diff --git a/bin/borderizer.sh b/bin/borderizer.sh new file mode 100755 index 0000000..f69874f --- /dev/null +++ b/bin/borderizer.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if [ $# -ne 3 -o "$1" = "-h" -o "$1" = "--help" ]; then + echo "$0 " + exit 1 +fi + +fold=$1 +tmpl=$2 +sfx=$3 + +w=$(identify -format "%w" ${fold}/00${sfx}.png) +h=$(identify -format "%h" ${fold}/00${sfx}.png) + +wt=$(identify -format "%w" "${tmpl}") +ht=$(identify -format "%h" "${tmpl}") + +x=$(((wt - w) / 2)) +y=$(((ht - h) / 2)) + +for card in $(seq 0 39); do + convert "$tmpl" $(printf "%s/%02d%s.png" "$fold" "$((seed * 10 + card))" "$sfx") \ + -geometry +${x}+${y} -composite $(printf "%s/%02d_bord%s.png" "$fold" "$((seed * 10 + card))" "$sfx") +done diff --git a/bin/sprite_main.sh b/bin/sprite_main.sh new file mode 100755 index 0000000..422e82e --- /dev/null +++ b/bin/sprite_main.sh @@ -0,0 +1,4 @@ +#!/bin/bash +./bin/borderizer.sh briskin5/img briskin5/img/with_border_template.png "" +./bin/spriter.sh briskin5/img "_bord" briskin5/img/cards_xx +geeqie briskin5/img/cards_xx_bord.png diff --git a/bin/spriter.sh b/bin/spriter.sh new file mode 100755 index 0000000..a972251 --- /dev/null +++ b/bin/spriter.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Max height in play area 121 px +# + +if [ $# -ne 3 -o "$1" = "-h" -o "$1" = "--help" ]; then + echo "$0 " + exit 1 +fi +fold=$1 +sfx=$2 +fou=$3 + +w=$(identify -format "%w" ${fold}/00${sfx}.png) +h=$(identify -format "%h" ${fold}/00${sfx}.png) + +convert -size $((w * 8))x$((h * 6)) xc:none ${fou}${sfx}_bg.png + +argz="${fou}${sfx}_bg.png" + +for seed in 0 1 2 3; do + for card in $(seq 0 9); do + x=$(((seed * 2 + card / 5) * w)) + y=$(((card % 5) * h)) + argz="$argz $(printf "%s/%02d%s.png" "$fold" "$((seed * 10 + card))" "$sfx") -geometry +${x}+${y} -composite " + done +done + +argz="$argz ${fou}${sfx}.png" +convert $argz diff --git a/briskin5/img/with_border_template.png b/briskin5/img/with_border_template.png new file mode 100644 index 0000000..03946d1 Binary files /dev/null and b/briskin5/img/with_border_template.png differ diff --git a/briskin5/img/with_border_template.xcf b/briskin5/img/with_border_template.xcf new file mode 100644 index 0000000..7ae892d Binary files /dev/null and b/briskin5/img/with_border_template.xcf differ diff --git a/img/beta.png b/img/beta.png new file mode 100644 index 0000000..22929b1 Binary files /dev/null and b/img/beta.png differ diff --git a/img/beta_light.png b/img/beta_light.png new file mode 100644 index 0000000..e2b40cf Binary files /dev/null and b/img/beta_light.png differ