MagickSetImageOpacity is an undefined function

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
mrBlaQ
Posts: 17
Joined: 2008-02-05T12:19:00-07:00

MagickSetImageOpacity is an undefined function

Post by mrBlaQ »

I'm using MagickWand 1.0.6 as a php extension on FreeBSD with a PHP version of 5.2.4. My ImageMagic version is 6.3.6

As stated in the topic MagickSetImageOpacity is undefined in my context. Any other MW functions I've tried work as expected. If this function does indeed exist, what is the proper way to call it?

If not, how can I accomplish a simple 'layer opacity' composition between two images. I have two images to compose on top of each other. The bottom layer will always be opaque and the top layer may or may not have an existing alpha mask.

Thank you,
Dave
mrBlaQ
Posts: 17
Joined: 2008-02-05T12:19:00-07:00

Re: MagickSetImageOpacity is an undefined function

Post by mrBlaQ »

My followup question, To me it seems MagickCompositeImage should have an 'argument' variable. Why doesn't it, or how can I set one? I basically want to accomplish the example here: http://www.imagemagick.org/Usage/compose/#dissolve
mrBlaQ
Posts: 17
Joined: 2008-02-05T12:19:00-07:00

Re: MagickSetImageOpacity is an undefined function

Post by mrBlaQ »

I answered my first problem. I had to add the following code...

Code: Select all

ZEND_FE( magicksetimageopacity, NULL )
right before

Code: Select all

ZEND_FE( magicksetimageoption, NULL )
in magickwand.c

I recompiled MagickWand and it seems to work now. I'm still interested in my followup question about the 'missing' argument value.

Thanks,
Dave
mrBlaQ
Posts: 17
Joined: 2008-02-05T12:19:00-07:00

Re: MagickSetImageOpacity is an undefined function

Post by mrBlaQ »

When there's a will, there's a way. I've discovered that I can set the opacity of my top layer image with the following syntax:

Code: Select all

MagickEvaluateImage($wnd, MW_DivideEvaluateOperator, (100/$alpha), MW_AlphaChannel);
Post Reply