Page 1 of 1

Caption inside Bounding Box

Posted: 2015-10-06T22:58:36-07:00
by ophelius
Hi there,
Is there a way to define a bounding box for the Caption option? Right now I have this:

convert -alpha on -background #00000050 -fill white -size 800x600 -gravity Center caption:"Test 1 2 3" png32:temp.png

and this centers the text nicely using the largest font possible. But let's say I wish to define a smaller area inside my image for the text so it doesn't extend all the way to the sides and top and bottom. For example, the final image is 800x600, but I never want text to be displayed outside an imaginary box of 700x550 located at the centre of the image, sort of like padding for the text. I hope that makes sense.

Thanks

Re: Caption inside Bounding Box

Posted: 2015-10-06T23:23:46-07:00
by fmw42
You need to create the text file with -size 700x550 and then composite it over your larger image or use -extent or -border to expand the size of the text image. See http://www.imagemagick.org/Usage/crop/#border and http://www.imagemagick.org/Usage/crop/#extent