Last active
January 10, 2016 04:04
-
-
Save webercoder/233230b6d780d94177fa to your computer and use it in GitHub Desktop.
Takes MTG CCGHQ XLHQ images, strips the border, and adds a border size of your chosing. Tested with only the unglued basics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -lt 1 ]; then | |
echo "Illegal number of parameters" | |
echo "Usage: $0 directory [border-size]" | |
exit | |
fi | |
if [ ! -z $2 ]; then | |
border=$2 | |
else | |
border=65 | |
fi | |
DIR=$1 | |
mkdir $1/output | |
for filename in $1/input/*; do | |
base=$(basename "$filename") | |
realbase="${base%%.*}" | |
dest=$1/output/$realbase-$border.png | |
convert $filename -crop 671x960+37+40 -bordercolor black -border ${border}x${border} $dest | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment