Skip to content

Instantly share code, notes, and snippets.

@du-song
Created December 28, 2016 03:08
Show Gist options
  • Save du-song/139604123489cb91986e5a8a0b1ba676 to your computer and use it in GitHub Desktop.
Save du-song/139604123489cb91986e5a8a0b1ba676 to your computer and use it in GitHub Desktop.
Crop 3x3 card images using ImageMagick
#!/bin/sh
## brew install imagemagick
OPT="-crop 3x3@ +repage +adjoin -fuzz 20% -trim -bordercolor White -border 10x10"
mkdir -p tiled
convert PLACEMENT-CARDS/PLACEMENT-CARDS-12-2016.jpg $OPT tiled/0PLACEMENT-1-tiles%02d.jpg
convert PLACEMENT-CARDS/PLACEMENT-CARDS-12-20162.jpg $OPT tiled/PLACEMENT-2-tiles%02d.jpg
convert PLACEMENT-CARDS/PLACEMENT-CARDS-12-20163.jpg $OPT tiled/PLACEMENT-3-tiles%02d.jpg
convert PLACEMENT-CARDS/PLACEMENT-CARDS-12-20164.jpg $OPT tiled/PLACEMENT-4-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-2016.jpg $OPT tiled/REQUEST-1-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20162.jpg $OPT tiled/REQUEST-2-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20163.jpg $OPT tiled/REQUEST-3-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20164.jpg $OPT tiled/REQUEST-4-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20165.jpg $OPT tiled/REQUEST-5-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20166.jpg $OPT tiled/REQUEST-6-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20167.jpg $OPT tiled/REQUEST-7-tiles%02d.jpg
convert REQUEST-CARD/REQUEST-CARDS-12-20168.jpg $OPT tiled/REQUEST-8-tiles%02d.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment