Skip to content

Instantly share code, notes, and snippets.

@thompiler
Last active May 29, 2018 12:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thompiler/3a4427042f50d1f2de6d to your computer and use it in GitHub Desktop.
Save thompiler/3a4427042f50d1f2de6d to your computer and use it in GitHub Desktop.
Adding drop shadows to images with Imagemagick (osx)

Example inputs:

seal

![google](https://cloud.githubusercontent.com/assets/2172513/10321801/7de66f36-6c2f-11e5-885d-3193094eb3d1.png)

Example outputs:

shadow-seal

![shadow-google](https://cloud.githubusercontent.com/assets/2172513/10321832/9f12f440-6c2f-11e5-88ec-984b790a9528.png)

Install Imagemagick

brew install imagemagick

Equal sides shadow

convert input.png \( +clone -background black -shadow 60x5+0+4 \) +swap -background white -layers merge +repage output.png

Right side shadow

convert input.png \( +clone -background black -shadow 60x5+5+5 \) +swap -background white -layers merge +repage output.png

Make your own command

(file name "shadow")

convert $1 \( +clone -background black -shadow 60x5+0+4 \) \
+swap -background white -layers merge +repage shadow-$1

Usage

shadow input.png

Output:

shadow-input.png

@mmcdaris
Copy link

mmcdaris commented Oct 6, 2015

✨ 🎆 This is awesome @ThomasCassady :D Thanks for getting this working. 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment