Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I would like to place a background image behind the text label ( fixed width ) and let the font text to auto scale in size without adding the -pointsize parameter.
The background image would be exactly the same size 300x187
Basically so it would be something like this:
I hope it's nothing too big and someone could help me.
You have to create the test to the size of the background image and overlay it. But if you want padding on the sides as in the last example, then you must specify the size reduced by the padding.
You do not mention your IM version or platform, which you should always do, since syntax differs between unix and windows.
Here is unix syntax.
buffer=20
ww=`convert pJxd9YV.jpg -format "%[fx:(w-2*$buffer)]" info:`
convert pJxd9YV.jpg \
\( -size ${ww}x -background none -fill white -font arial label:"Quick Test" \) \
-gravity center -compose over -composite result.jpg
fmw42 wrote:You have to create the test to the size of the background image and overlay it. But if you want padding on the sides as in the last example, then you must specify the size reduced by the padding.
You do not mention your IM version or platform, which you should always do, since syntax differs between unix and windows.
Here is unix syntax.
buffer=20
ww=`convert pJxd9YV.jpg -format "%[fx:(w-2*$buffer)]" info:`
convert pJxd9YV.jpg \
\( -size ${ww}x -background none -fill white -font arial label:"Quick Test" \) \
-gravity center -compose over -composite result.jpg
Hi Fred
Sorry i didn't mention it earlier, I'm on a Ubuntu with Version: ImageMagick 6.5.7-8 2012-08-17 Q16
Thank you very much for the syntax you gave, it's worked perfectly just the way I was hoping for! I'll adjust the padding accordingly for my work.
Cheers for explaining everything!
I appreciate your help and Thank you again Fred