Created
May 8, 2012 06:54
-
-
Save kurosuke/2633152 to your computer and use it in GitHub Desktop.
effect round and shadow to image with ImageMagick command
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/sh | |
for i in `/bin/ls *.jpg` | |
do | |
FILE=$i | |
GEOM=`identify $FILE | awk '{print $3}'` | |
WIDTH=`echo $GEOM| awk -Fx '{print $1}'` | |
HEIGHT=`echo $GEOM| awk -Fx '{print $2}'` | |
C_WIDTH=`expr $WIDTH + 5` | |
C_HEIGHT=`expr $HEIGHT + 5` | |
R_WIDTH=`expr $WIDTH - 5` | |
R_HEIGHT=`expr $HEIGHT - 5` | |
convert -size ${C_WIDTH}x${C_HEIGHT} -draw "roundRectangle 0,0,${R_WIDTH},${R_HEIGHT},13,13" -roll +5+5 -blur 5,5 tile:white.ppm bokashi.jpg | |
convert -size ${WIDTH}x${HEIGHT} -fill "#FFFFFF" -draw "roundRectangle 0,0,${WIDTH},${HEIGHT},13,13" tile:black.ppm r_mask.jpg | |
composite -compose plus r_mask.jpg bokashi.jpg masked_bokashi.jpg | |
convert -size ${WIDTH}x${HEIGHT} -draw "roundRectangle 0,0,${WIDTH},${HEIGHT},13,13" tile:white.ppm mask.jpg | |
composite -compose plus $FILE mask.jpg masked.jpg | |
composite -compose Multiply masked.jpg masked_bokashi.jpg thumbnails/$FILE | |
done | |
rm -f r_mask.jpg bokashi.jpg masked_bokashi.jpg mask.jpg masked.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment