Created
December 21, 2020 13:10
-
-
Save timrach/590b75f292f2b67aed53931202fc4043 to your computer and use it in GitHub Desktop.
ImageMagick Cheat Sheet
This file contains 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 | |
# Take a window of 600x600 pixels of each image and slice it into tiles of 200x200 pixels. | |
# Save the tiles into a folder ./tiles | |
mkdir ./tiles | |
for f in *.jpg; do | |
filename=$(basename -- "$f") | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
echo "Processing $f file.."; | |
convert $f -gravity center -crop 600x600+0+0 +gravity +repage -crop 200x200 +repage ./tiles/"$filename"_%d.jpg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment