Improving my "caption:" code
Posted: 2019-09-20T23:26:39-07:00
Hi there,
I'm not a great whizz with linux scripting etc.
I'm running ImageMagick 6.9.10-14 Q16 x86_64 20181023 as this is the version my Ubuntu comes with and I got a bit lost with the manual update instructions.
I love the text flow abilities of the "caption:" option but want the caption to be on a new blank border so I can see the full original image.
I've got a solution working, its not pretty though. Perhaps someone can suggest a performance improvement using the ImageMagick 6.9.10-14 ?
Here is my code. As you see, I run convert twice which I'm guessing isn't the best way of doing things:
height=`identify -format %h "$fileorig"`
spl=$(expr $height / 10) ; # controls height of the box at the bottom
convert "$fileorig" -gravity South -splice 0x$spl "$filenew"
convert -background gold -fill black -gravity center -size ${width}x$spl \
caption:"$comment" \
"$filenew" +swap -gravity south -composite "$filenew"
Your suggestions would be greatly appreciated!
I'm not a great whizz with linux scripting etc.
I'm running ImageMagick 6.9.10-14 Q16 x86_64 20181023 as this is the version my Ubuntu comes with and I got a bit lost with the manual update instructions.
I love the text flow abilities of the "caption:" option but want the caption to be on a new blank border so I can see the full original image.
I've got a solution working, its not pretty though. Perhaps someone can suggest a performance improvement using the ImageMagick 6.9.10-14 ?
Here is my code. As you see, I run convert twice which I'm guessing isn't the best way of doing things:
height=`identify -format %h "$fileorig"`
spl=$(expr $height / 10) ; # controls height of the box at the bottom
convert "$fileorig" -gravity South -splice 0x$spl "$filenew"
convert -background gold -fill black -gravity center -size ${width}x$spl \
caption:"$comment" \
"$filenew" +swap -gravity south -composite "$filenew"
Your suggestions would be greatly appreciated!