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?".
robocop
Posts: 32 Joined: 2013-03-22T23:15:09-07:00
Authentication code: 6789
Post
by robocop » 2018-06-15T22:17:57-07:00
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
Result:
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
Post
by snibgo » 2018-06-16T00:44:28-07:00
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
robocop
Posts: 32 Joined: 2013-03-22T23:15:09-07:00
Authentication code: 6789
Post
by robocop » 2018-06-16T02:20:30-07:00
Hi Snibgo,
Thank you so much. It was just what i needed and worked perfectly. Cheers
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 | Ubuntu 18.04.1 LTS