Hi everyone
I have a file "words.txt" containing hundreds of lines of text. Each line contains a slogan.
Using the code below i am able to generate an image with the slogan text from each line.
The image filename is saved matching the last word on each line.
Example:
Line 1: We do great things > things.jpg
Line 2: Make it happen > happen.jpg
Line 3: Go the extra mile > mile.jpg
Is it possible to save the image filename as the line number from the text file ?
What i would like is this:
Line 1: We do great things > 1.jpg
Line 2: Make it happen > 2.jpg
Line 3: Go the extra mile > 3.jpg
I would greatly appreciate some help. Thank you!
cat words.txt | \
while read word; do
convert canvas.jpg \
\( -size 350x350 -background none \
-fill white -gravity center caption:"$word" -trim +repage -depth 8 \) \
-gravity center -composite $word.jpg
done