Skip to content

Instantly share code, notes, and snippets.

@sairam
Last active April 9, 2017 13:55
Show Gist options
  • Save sairam/732bdb51d7f4dc16099cf5144dddcc0a to your computer and use it in GitHub Desktop.
Save sairam/732bdb51d7f4dc16099cf5144dddcc0a to your computer and use it in GitHub Desktop.
Generate a Banner with an Image
# Usage generate_banner "Read Later Tools are Productivity Killers"
function generate_banner() {
wget -O header-plain.jpg "https://source.unsplash.com/featured/1200x630/?mountains"
echo -n $1| convert -size 1200 -font BrushScriptI -pointsize 80 -gravity center -background rgba\(0,0,0,0.5\) -fill white caption:'@-' text.png
composite -channel rgba -alpha set -gravity south text.png header-plain.jpg header-title.jpg
open header-title.jpg
echo "copy header-title.png to your destination"
echo "rm header-title.jpg header-plain.jpg text.png"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment