Fred's autocaption and semi-transparency

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
djd
Posts: 41
Joined: 2011-11-12T22:20:18-07:00
Authentication code: 8675308

Fred's autocaption and semi-transparency

Post by djd » 2012-03-06T05:06:48-07:00

If an image is somewhat crowded, a caption will overlap other detail. So it would be
helpful if the caption could be semi-transparent. I tried this colour:
-c "rgb(111,198,242,0.2)" and this
-c "rgb(111,198,242,0.8)"
with both gif and png files. The caption colour was opaque in all cases.

Is there a way to create a semi transparent caption?

Regards

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Fred's autocaption and semi-transparency

Post by anthony » 2012-03-06T06:14:19-07:00

Make sure the image has 'alpha' enabled. Sometimes this effects how secondary images are generated and then overlaid. The caption operator (image coder actually) may be one of those cases, as it uses a external delegate library to convert text into an image. It could be regarded as small bug.

EG -alpha set should be applied after reading the image. By default alpha is not saved if the image ha fully opaque when writing (unles you override that).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

User avatar
fmw42
Posts: 25407
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fred's autocaption and semi-transparency

Post by fmw42 » 2012-03-06T11:57:29-07:00

I make this mistake all the time
-c "rgb(111,198,242,0.2)" and this
try

-c "rgba(111,198,242,0.2)"

it works for me


see
http://www.imagemagick.org/script/color.php

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Fred's autocaption and semi-transparency

Post by anthony » 2012-03-06T19:30:15-07:00

Good spot Fred! I missed it!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

User avatar
fmw42
Posts: 25407
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fred's autocaption and semi-transparency

Post by fmw42 » 2012-03-06T19:56:56-07:00

anthony wrote:Good spot Fred! I missed it!
I missed it also at first and went about testing my script. I spent some time until I realized that was the mistake and not my script.

Post Reply