diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-04-23 01:44:54 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:22 +0200 |
commit | bb449ea7ce9224284c2b60698cf0b0c7d70f9c71 (patch) | |
tree | 63569033b59d2180660bcebca71a98e4dede9ccf /tools/crop.sh | |
parent | 4936b1e7ff063e4d5d888d467f553d87a4a49abf (diff) | |
download | time-of-crisis-bb449ea7ce9224284c2b60698cf0b0c7d70f9c71.tar.gz |
Asset scripts and start of client.
Diffstat (limited to 'tools/crop.sh')
-rw-r--r-- | tools/crop.sh | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/tools/crop.sh b/tools/crop.sh new file mode 100644 index 0000000..11ee84b --- /dev/null +++ b/tools/crop.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +mkdir -p /tmp/1x /tmp/2x /tmp/xx images + +HEX=800x924 + +# - original size - +# SQUARE=896x896 +# RECT=1488x752 +# CIRCLE=816x816 +# HEX=800x924 + +# - trimmed 1px border - +SQUARE=880x880 +RECT=1472x736 +CIRCLE=800x800 + +# FILTER="-filter triangle +# UNSHARP="-unsharp 0x1+0.5" + +function resize() { + B=$(basename $2) + echo $B + convert $2 -gravity Center -crop $1+0+0 +repage -colorspace RGB $FILTER -resize 12.5% $UNSHARP -colorspace sRGB images/$B +} + +function crop_only() { + B=$(basename $2) + echo $B + convert tools/original/$B -gravity Center -crop $1+0+0 +repage /tmp/xx/$B +} + +function resize_only() { + B=$(basename $1) + echo $B + convert $1 -colorspace RGB $FILTER -resize 12.5% $UNSHARP -colorspace sRGB images/$B +} + +for F in tools/original/legion_full_*.png tools/original/legion_reduced_*.png +do + crop_only $SQUARE $F +done +montage -mode concatenate -tile 9x /tmp/xx/legion_full_*.png tools/original/legion_full.png +montage -mode concatenate -tile 9x /tmp/xx/legion_reduced_*.png tools/original/legion_reduced.png + +resize_only tools/original/legion_full.png +resize_only tools/original/legion_reduced.png + +resize $RECT tools/original/amphitheater.png +resize $RECT tools/original/basilica.png +resize $RECT tools/original/limes.png + +resize $RECT tools/original/amphitheater_back.png +resize $RECT tools/original/basilica_back.png +resize $RECT tools/original/limes_back.png + +resize $SQUARE tools/original/alamanni_active.png +resize $SQUARE tools/original/alamanni_inactive.png +resize $SQUARE tools/original/ardashir.png +resize $SQUARE tools/original/cniva.png +resize $SQUARE tools/original/cniva_back.png +resize $SQUARE tools/original/first_player.png +resize $SQUARE tools/original/franks_active.png +resize $SQUARE tools/original/franks_inactive.png +resize $SQUARE tools/original/goths_active.png +resize $SQUARE tools/original/goths_inactive.png +resize $SQUARE tools/original/militia.png +resize $SQUARE tools/original/no_place_governor.png +resize $SQUARE tools/original/nomads_active.png +resize $SQUARE tools/original/nomads_inactive.png +resize $SQUARE tools/original/rival_back.png +resize $SQUARE tools/original/rival_postumus.png +resize $SQUARE tools/original/rival_priest_king.png +resize $SQUARE tools/original/rival_zenobia.png +resize $SQUARE tools/original/sassanids_active.png +resize $SQUARE tools/original/sassanids_inactive.png +resize $SQUARE tools/original/shapur.png +resize $SQUARE tools/original/shapur_back.png +resize $SQUARE tools/original/red_emperor_turns.png +resize $SQUARE tools/original/red_general.png +resize $SQUARE tools/original/blue_emperor_turns.png +resize $SQUARE tools/original/blue_general.png +resize $SQUARE tools/original/yellow_emperor_turns.png +resize $SQUARE tools/original/yellow_general.png +resize $SQUARE tools/original/green_emperor_turns.png +resize $SQUARE tools/original/green_general.png + +resize $HEX tools/original/mob.png +resize $HEX tools/original/mob_x2.png +resize $HEX tools/original/castra.png +resize $HEX tools/original/quaestor.png +resize $HEX tools/original/red_breakaway.png +resize $HEX tools/original/blue_breakaway.png +resize $HEX tools/original/yellow_breakaway.png +resize $HEX tools/original/green_breakaway.png +resize $HEX tools/original/red_seat_of_power.png +resize $HEX tools/original/blue_seat_of_power.png +resize $HEX tools/original/yellow_seat_of_power.png +resize $HEX tools/original/green_seat_of_power.png + +resize $CIRCLE tools/original/neutral_governor.png +resize $CIRCLE tools/original/red_governor.png +resize $CIRCLE tools/original/red_legacy.png +resize $CIRCLE tools/original/red_legacy_40.png +resize $CIRCLE tools/original/blue_governor.png +resize $CIRCLE tools/original/blue_legacy.png +resize $CIRCLE tools/original/blue_legacy_40.png +resize $CIRCLE tools/original/yellow_governor.png +resize $CIRCLE tools/original/yellow_legacy.png +resize $CIRCLE tools/original/yellow_legacy_40.png +resize $CIRCLE tools/original/green_governor.png +resize $CIRCLE tools/original/green_legacy.png +resize $CIRCLE tools/original/green_legacy_40.png + +resize $CIRCLE tools/original/blue_governor_emperor.png +resize $CIRCLE tools/original/green_governor_emperor.png +resize $CIRCLE tools/original/red_governor_emperor.png +resize $CIRCLE tools/original/yellow_governor_emperor.png + +resize $SQUARE tools/original/blue_general_emperor.png +resize $SQUARE tools/original/green_general_emperor.png +resize $SQUARE tools/original/red_general_emperor.png +resize $SQUARE tools/original/yellow_general_emperor.png |