Skip to content

Instantly share code, notes, and snippets.

@jamesrampton
Created April 29, 2022 15:20
Show Gist options
  • Save jamesrampton/bb57d6c9127a460a245bb815161414cd to your computer and use it in GitHub Desktop.
Save jamesrampton/bb57d6c9127a460a245bb815161414cd to your computer and use it in GitHub Desktop.
GraphicsMagick add 10% border based on shortest edge
#!/usr/bin/env bash
BORDER=$((`gm identify -format "%w\n%h" image.jpg | sort -n | head -1`*10/100))
gm convert -border $BORDERx$BORDER -bordercolor #111111 image.jpg image-with-border.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment