Transparency of a fill

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?".
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony » 2006-08-01T23:05:53-07:00

That is a tricky matter.

Outside the -draw MVG commands, you are limited to using the -fill setting option. This will only accept eitehr a previously defined color name, or a set of numbers. As the only non-opaque color pre-defined is "none" or "transparent" you are basically out of luck in that regard.

You will thus need to resourt to using numbers.
For examples See IM Examples, Channels, Semi-Transparent colors
http://www.cit.gu.edu.au/~anthony/graph ... els/#color

Sorry about the odd position of that, but it was and still is the most logical place in to put that information (EG alpha/matte channel info)

If you are using draw, you have more choice. As -draw uses MVG graphics lanuage, which is designed as a simplified SVG language, it can define the color and transparency seperatally.

Code: Select all

-draw 'fill  red  fill-opacity 0.6  .... '
See IM Examples, Drawing, MVG Specific Settings
http://www.cit.gu.edu.au/~anthony/graph ... g_settings

Unfortunatally, 'fill-opacity' is not availbale to the command line, though it would be a nice addition, as would 'stroke-opacity'.

Enjoy.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply