Skip to content

Instantly share code, notes, and snippets.

@bandarji
Last active October 4, 2016 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bandarji/628443127d72d6c7a3d909324a26554e to your computer and use it in GitHub Desktop.
Save bandarji/628443127d72d6c7a3d909324a26554e to your computer and use it in GitHub Desktop.
Place a border around an image with ImageMagick
# 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