#!/usr/bin/env zsh
# THIS IS A LEGACY TOOL THAT WAS USED FOR THE INITIAL
# ASSET EXTRACTION - ASSETS HAVE SINCE BEEN HEAVILY
# MODIFIED, MAKING THIS SCRIPT PRETTY USELESS
if [[ $# -lt 2 ]]; then
echo "Usage: $0
"
exit 1
fi
if [[ $2 == "top" ]]; then
gravity="South"
elif [[ $2 == "bottom" ]]; then
gravity="North"
else
echo "Usage: $0 "
exit 1
fi
for file in $1/*; do
magick "$file" -gravity $gravity -chop 0x10 "$file"
magick "$file" -transparent Black PNG24:"$file"
magick "$file" -fill "rgb(0,255,0)" -opaque White "$file"
magick "$file" -gravity Center -background None -compose Copy -extent 260x $file
# Bar is commented out for an experiment with rendering in real time on the watch
#magick "$file" -gravity $gravity -background White -splice 0x15 $file
if [[ $2 == "top" ]]; then
magick "$file" -gravity North -background None -splice 0x41 $file
else
magick "$file" -gravity South -background None -splice 0x41 $file
fi
done