Page 1 of 1

how to set semi-transparent background but not text on it

Posted: 2014-08-15T23:04:33-07:00
by ravikum
hello,
I want to write some message on a semi transparent background.

So, I am using this code :

Code: Select all

/usr/local/bin/convert -size 250x -background '#aaff00' -alpha set -channel A -evaluate set 50% -font Verdana -density 96 -pointsize 14 -fill '#e80b0b' -gravity Center caption:'Long Test Message' output.png
However, this code is making the caption also as transparent.

I don't want the capton to be transparent.
I need to composite this image on another image.

Please suggest.

Thanks

(I am using the latest IM version on linux centos 6)

Re: how to set semi-transparent background but not text on i

Posted: 2014-08-16T00:06:23-07:00
by snibgo
Commands should be given in the "natural" order: do something, then do something else, etc. If you give them in a weird order, results will be weird.

You put "-evaluate set 50%" before you have created the image, which doesn't happen until "caption:".

You could do it like this:

Code: Select all

convert -size 250x -background '#aaff0080' -fill '#e80b0b' -gravity center caption:'Long test message' r.png
I have specified the transparency as a 4th channel to the background.

Re: how to set semi-transparent background but not text on i

Posted: 2014-08-16T00:13:49-07:00
by ravikum
thanks a lot for quick reply.
I will try this code.