Skip to content

Instantly share code, notes, and snippets.

@amendezcabrera
Last active February 24, 2017 08:56
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 amendezcabrera/5dc4d6518e58b5ce183cb866e3158b80 to your computer and use it in GitHub Desktop.
Save amendezcabrera/5dc4d6518e58b5ce183cb866e3158b80 to your computer and use it in GitHub Desktop.
Bash script to create multiple instances of an image with different texts in each one
# Requirements: imagemagick
# Usage: add_text_to_image.sh FileWithTextLines.txt
#!/bin/bash
COUNTER=1
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "Text to insert ($COUNTER): $line"
convert -pointsize 36 -draw "text 390,135 '$line'" imgsrc.png imgdst$COUNTER.png
let COUNTER=COUNTER+1
done < "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment