Page 1 of 1

Semi-transparent background

Posted: 2018-06-15T22:17:57-07:00
by robocop
Hi all !

I'm using the following wood texture background and code to generate the image below.

I was wondering how to make the white rounded square background Semi-transparent so a bit of the wood texture shows through it?

I have the text fully transparent and would also like the white background to be about 50% transparent if possible.

Thank you for your help!

Code: Select all

convert \( -size 450x450 xc:white \) \
\( +clone  -alpha extract \
-draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \
\) -alpha off -compose CopyOpacity -composite \
\( -size 400x400 -background none -fill white -gravity center \
-font arial label:"let's\nbe\nHAPPY"  \) \
-gravity center -compose dstout -composite -alpha on \
canvas.jpg +swap -compose over -composite sample.png
Image

Result:
Image

Re: Semi-transparent background

Posted: 2018-06-16T00:44:28-07:00
by snibgo
Insert "-evaluate Multiply 0.3" (or whatever opacity you want) like this:

Code: Select all

convert \( -size 450x450 xc:white \) \
\( +clone  -alpha extract \
-draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \
-evaluate Multiply 0.3 \
\) -alpha off -compose CopyOpacity -composite \
\( -size 400x400 -background none -fill white -gravity center \
-font arial label:"let's\nbe\nHAPPY"  \) \
-gravity center -compose dstout -composite -alpha on \
canvas.jpg +swap -compose over -composite out.png

Re: Semi-transparent background

Posted: 2018-06-16T02:20:30-07:00
by robocop
Hi Snibgo,

Thank you so much. It was just what i needed and worked perfectly. Cheers :)

Image