Skip to content

Instantly share code, notes, and snippets.

@yradunchev
Created December 27, 2012 05:14
Show Gist options
  • Save yradunchev/4385655 to your computer and use it in GitHub Desktop.
Save yradunchev/4385655 to your computer and use it in GitHub Desktop.
add caption to picture...
#!/bin/bash
[[ "$#" -eq 2 ]] || { echo "Usage: ${0} pict.ure \"caption text\"" >&2; exit 1; }
convert \
-size $(identify -format %w ${1})x40 \
-background transparent \
-gravity center \
-font Helvetica-Bold \
-fill yellow \
-pointsize 40 \
caption:"${2}" ${1} \
+swap \
-gravity south \
-composite ${1%.*}_${2}.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment