Setting image/wand opacity

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Setting image/wand opacity

Post by el_supremo »

I would like to use MagickWand to read in a JPG image, which does not have an opacity layer, and then set it so that it does have a given opacity (which should implicitly force the image's matte value to MagicTrue) so that I can use it in subsequent operations requiring that it have a matte/opacity layer and/or write it out as a PNG. So far, I haven't been able to find a MagicWand function or combination of functions which will do this.
ImageMagick has the SetImageOpacity function which does exactly what I want but this function does not have a corresponding function in the MagicWand API. Can this, or an equivalent function be added to MagickWand?

Thanks
Pete
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

MagickWand has the MagickSetImageMatte() method which sets the image opacity channel to completely opaque.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Post by el_supremo »

Thanks.
MagickSetImageMatte isn't in the 6.2.6 code that I've been using - it only has MagickSetImageMatteColor. I really must upgrade.

Pete
Post Reply