Skip to content

Instantly share code, notes, and snippets.

@webercoder
Last active January 10, 2016 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webercoder/233230b6d780d94177fa to your computer and use it in GitHub Desktop.
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.
#!/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