Created
April 20, 2011 14:44
-
-
Save sharjeelaziz/931513 to your computer and use it in GitHub Desktop.
Convert Adobe Illustrator files to pngs, crop them, and create thumbnails
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 | |
if [ ! -d ./png ]; then mkdir ./png; fi; | |
# convert Adobe Illustrator to pngs | |
# uses ImageMagick | |
for f in *.ai; | |
do | |
echo "Processing $f" | |
convert -density 300 $f ./png/${f/.ai}_raw.png | |
echo "Cropping ./png/${f/.ai}_raw.png" | |
convert ./png/${f/.ai}_raw.png -trim ./png/${f/.ai}.png | |
echo "Creating thumb ./png/${f/.ai}_thumb.png" | |
convert ./png/${f/.ai}.png -resize 64x64^ -gravity center -extent 64x64 ./png/${f/.ai}_thumb.png | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment