Transparent caption text

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
robocop
Posts: 32
Joined: 2013-03-22T23:15:09-07:00
Authentication code: 6789

Transparent caption text

Post by robocop »

Hi folks!

I was wondering if it is possible to make a caption text fully transparent.
Image

http://www.imagemagick.org/Usage/text/#caption_bestfit

Code: Select all

convert -background lightblue -fill blue -font Candice -size 320x140 \
          caption:'This text is resized to best fill the space given.' \
          caption_filled.gif
I tried with -fill none and didn't have any success.

What would be the correct method?

Thank you
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 | Ubuntu 18.04.1 LTS
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Transparent caption text

Post by snibgo »

A method is:

Code: Select all

convert -size 320x140 caption:Hello -alpha copy -fill Red -colorize 100 x.png
snibgo's IM pages: im.snibgo.com
robocop
Posts: 32
Joined: 2013-03-22T23:15:09-07:00
Authentication code: 6789

Re: Transparent caption text

Post by robocop »

Thank you snibgo!

I tried the code and unfortunately it just gave a red canvas.

I will attempt to upgrade my imagemagick on Ubuntu and try this again.

Cheers
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 | Ubuntu 18.04.1 LTS
Post Reply