Created
March 23, 2023 19:24
-
-
Save nickboucher/6f9b2b490d4dbfbbee735b0d728f86af to your computer and use it in GitHub Desktop.
MacOS-Screenshot Drop Shadow + Rounded Corners
This file contains hidden or 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
# 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
Credits: