Page 1 of 1

How to add to image a text with some transparency; optionally with some noise?

Posted: 2019-10-05T14:01:52-07:00
by ardb
Hi All
Im complete newbie to imagemagick.
I've just learned how to add text label onto image (-text option).
Now I'd like to make it a bit transparent. I searched for it but I cannot find anything with "opacity" or "transparency" connected to -text operation.
Is it possible to make it semi-opaque? And how?
And advanced one: Is it possible to add some noise in Value,Saturation,Opacity channel(s) to such text (or to any other added primitive)?

Re: How to add to image a text with some transparency; optionally with some noise?

Posted: 2019-10-05T14:07:52-07:00
by snibgo
What version of IM, on what platform?

There is no "-text" option. Please show the command you used.

Perhaps you need an alpha setting within a colour, eg "#abcd".

Re: How to add to image a text with some transparency; optionally with some noise?

Posted: 2019-10-05T14:54:38-07:00
by ardb
Linux, Debian.
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101
Sorry - I mixed-up keywords. I meant -draw 'text "ABC"' operation. I apologize.

Re: How to add to image a text with some transparency; optionally with some noise?

Posted: 2019-10-05T15:44:54-07:00
by snibgo
Bash syntax:

Code: Select all

convert toes.png -gravity Center -pointsize 40 -fill "#f008" -draw 'text 0,0 "Hello world"' toes_hw.jpg
The colour for the text is #f008, semi-transparent red.
Image

Re: How to add to image a text with some transparency; optionally with some noise?

Posted: 2019-10-05T17:33:00-07:00
by fmw42
As snibgo has indicated, use a partially transparent color. You can use hex or rgb definitions. See https://imagemagick.org/script/color.php

Re: How to add to image a text with some transparency; optionally with some noise?

Posted: 2019-10-07T01:37:38-07:00
by ardb
Thanks a lot!