Skip to content

Instantly share code, notes, and snippets.

@nickboucher
Created March 23, 2023 19:24
Show Gist options
  • Save nickboucher/6f9b2b490d4dbfbbee735b0d728f86af to your computer and use it in GitHub Desktop.
Save nickboucher/6f9b2b490d4dbfbbee735b0d728f86af to your computer and use it in GitHub Desktop.
MacOS-Screenshot Drop Shadow + Rounded Corners
# Adds a drop shadow and rounded edges to images
# similar to MacOS App screenshots
#
# Requires ImageMagick:
# brew install imagemagick
#
# Add to ~/.zshrc or ~/.bashrc for easy usage
#
# Usage:
# shadow image.png
shadow () { convert "$@" \( +clone -alpha extract -draw 'fill black polygon 0,0 0,18 18,0 fill white circle 18,18 18,0' \( +clone -flip \) -compose Multiply -composite \( +clone -flop \) -compose Multiply -composite \) -alpha off -compose CopyOpacity -composite "$@" && convert "$@" \( +clone -background black -shadow 80x20+0+15 \) +swap -background transparent -layers merge +repage "$@"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment