Last active
October 4, 2016 16:28
-
-
Save bandarji/628443127d72d6c7a3d909324a26554e to your computer and use it in GitHub Desktop.
Place a border around an image with ImageMagick
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
# Bash function to place a border around an image with ImageMagick | |
function borderimg() { | |
if [ -z ${3} ]; then | |
echo "Usage: borderimg <imageFile> <whiteBorderSize> <blackBorderSize>" | |
else | |
identify ${1} | |
mogrify -border ${2}x${2} -bordercolor white ${1} | |
mogrify -border ${3}x${3} -bordercolor black ${1} | |
identify ${1} | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment