Bash script to create multiple instances of an image with different texts in each one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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