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

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?".
Post Reply
ardb
Posts: 3
Joined: 2019-10-05T13:53:43-07:00
Authentication code: 1152

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

Post 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)?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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".
snibgo's IM pages: im.snibgo.com
ardb
Posts: 3
Joined: 2019-10-05T13:53:43-07:00
Authentication code: 1152

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
ardb
Posts: 3
Joined: 2019-10-05T13:53:43-07:00
Authentication code: 1152

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

Post by ardb »

Thanks a lot!
Post Reply