Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobrien/876410 to your computer and use it in GitHub Desktop.
Save tobrien/876410 to your computer and use it in GitHub Desktop.
This is a problem I used to solve with Photoshop macros. Here's the problem to be solved. You have hundreds of screen captures and you want to turn these screen captures into images with a dropshadow that will be included in a book. Add to this the
#!/bin/bash
# Convert Originals to Web Images
for IMAGE in `find ./orig -name "*.png"`
do
DEST_IMAGE=./web/`basename $IMAGE`
if [[ ! -e $DEST_IMAGE || $IMAGE -nt $DEST_IMAGE ]]
then
convert $IMAGE -verbose -compress jpeg \
-quality 80 -bordercolor None -border 10x10 \
\( +clone -background black -shadow 80x3+5+5 \) \
-compose DstOver -composite -compose Over \
$DEST_IMAGE
fi
done
# Convert Originals to Print Images
for IMAGE in `find ./orig -name "*.png"`
do
DEST_IMAGE=./print/`basename $IMAGE .png`.pdf
if [[ ! -e $DEST_IMAGE || $IMAGE -nt $DEST_IMAGE ]]
then
convert $IMAGE -resize 250% -compress jpeg \
-quality 50 -density 150 -verbose \
-bordercolor None -border 10x10 \
\( +clone -background black -shadow 80x3+5+5 \) \
-compose DstOver -composite -compose Over \
$DEST_IMAGE
fi
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment