Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.