How to get dimensions after resize?
Posted: 2007-08-18T22:21:57-07:00
Hello,
I'm resizing images to a fixed width but the height varies every time. I would like to add a rounded border which requires knowing the dimensions of the new image. The following code creates an image of some text on white background with some padding.
According to one of the usage pages I could use 'roundrectangle 1,1 %[fx:w-10],%[fx:h-10] 15,15' but the parameters are not substituted in the -draw command. Is there a solution other than using a temp file? I would like to have all this done in the same pass. Is this possible?
Thanks.
I'm resizing images to a fixed width but the height varies every time. I would like to add a rounded border which requires knowing the dimensions of the new image. The following code creates an image of some text on white background with some padding.
Code: Select all
convert -background white -fill black \
-font Helvetica -pointsize 200 label:"TEXT HERE" \
-bordercolor white -border 20x20 \
-resize 300 \
image.png
Thanks.