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?".
The Transporter
Posts: 14 Joined: 2007-01-15T13:54:49-07:00
Post
by The Transporter » 2011-02-12T02:18:12-07:00
Hello,
I'm trying to make a simple transparent square using:
Code: Select all
convert -size 200x200 xc:none -fill '#0008' square.png
But if doesn't work.
I've read on the forum that I need to use dstOut but I don't find any example.
Can you provide a simple example who draws a square or a rectangle filled with a color and where we can set a transparency ?
Thanks alot!
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2011-02-12T02:54:07-07:00
Not sure what you mean as you want a transparent rectange filled with colour - that is what you created with your code.
Do you want a rectangle that is colored but you can set the opacity ?
Try this using the RGB alpha setting.
Code: Select all
convert -size 200x200 xc:rgba(255, 0, 0, 0.4) square.png
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2011-02-12T10:49:44-07:00
convert -size 200x200 xc:rgba(255, 0, 0, 0.4) square.png
This might need quotes so that the spaces are not interpretted
convert -size 200x200 xc:"rgba(255, 0, 0, 0.4)" square.png
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2011-02-12T18:43:10-07:00
You did not mention your IM version number.
Some of the recent IM releases had PNG problems
use png32:square.png if the direct to png approach is not working (you get opaque or fully-transparent).
Upgrade if you are not sure.