How to dim or reduce opacity on annotation
Posted: 2018-11-01T03:13:41-07:00
Trying to create a straightforward watermark, I've worked through the excellent examples section https://imagemagick.org/Usage/annotating/ but unfortunately all the syntax is for V6 whereas I have 7.0.8-14 Q16 x64 on Win10 and the syntax seems to have got a helluva lot more complicated.
Ideally, I would reproduce the final example which under V6 is: Here we create a simple label on a semi-transparent background, and overlay it.
convert -background '#00000080' -fill white label:'Faerie Dragon' miff:- |\
composite -gravity south -geometry +0+3 \
- dragon.gif anno_composite.jpg
but I've got nowwhere trying to convert that to V7 syntax. I wonder if anyone is clever enough to rewrite this in V7 syntax?
I could live with the prior example, however which is: ...get ImageMagick to use an 'undercolor' on a text box:
convert dragon.gif -fill white -undercolor '#00000080' -gravity South \
-annotate +0+5 ' Faerie Dragon ' anno_undercolor.jpg
and I've got somewhere with this - the following works:
magick bt.jpg -resize 800 -gravity center -pointsize 50 -fill white -undercolor lightgray -stroke white -strokewidth 2 -draw "text 0,120 ' © gamesboard.org.uk '" btannotated.jpg
except for the fact that the boxed text is not semi-transparent. It needs to have an opacity of 50% or whatever so that the image underneath is not completely obscured. All efforts to achieve that have failed dismally. Probably because I just don't understand what part of the old example is doing the dimming. I can't see anything in the syntax relating to opacity and if it's something about the code of '#00000080' in the undercolor that's doing it, the syntax doesn't work for the magick command. Can anyone advise how to render the text box with some transparency?
many thanks for any pointers...
Ideally, I would reproduce the final example which under V6 is: Here we create a simple label on a semi-transparent background, and overlay it.
convert -background '#00000080' -fill white label:'Faerie Dragon' miff:- |\
composite -gravity south -geometry +0+3 \
- dragon.gif anno_composite.jpg
but I've got nowwhere trying to convert that to V7 syntax. I wonder if anyone is clever enough to rewrite this in V7 syntax?
I could live with the prior example, however which is: ...get ImageMagick to use an 'undercolor' on a text box:
convert dragon.gif -fill white -undercolor '#00000080' -gravity South \
-annotate +0+5 ' Faerie Dragon ' anno_undercolor.jpg
and I've got somewhere with this - the following works:
magick bt.jpg -resize 800 -gravity center -pointsize 50 -fill white -undercolor lightgray -stroke white -strokewidth 2 -draw "text 0,120 ' © gamesboard.org.uk '" btannotated.jpg
except for the fact that the boxed text is not semi-transparent. It needs to have an opacity of 50% or whatever so that the image underneath is not completely obscured. All efforts to achieve that have failed dismally. Probably because I just don't understand what part of the old example is doing the dimming. I can't see anything in the syntax relating to opacity and if it's something about the code of '#00000080' in the undercolor that's doing it, the syntax doesn't work for the magick command. Can anyone advise how to render the text box with some transparency?
many thanks for any pointers...