arrowman
arrowman

Reputation: 426

Translate ImageMagick CLI to PHP Imagick API

I have problem with translating ImageMagick CLI command to Imagick PHP API. I looked at threads about it on Stackoverflow but people there used other commands...

> convert color-to-add.png test.png -compose CopyOpacity mask-with-alpha.png
> composite -compose multiply test.png mask-with-alpha.png compose-result.png

I can't use exec method.

I still try do do something with this but I spent a lot of time and have nothing to this moment (I started to think that it is imposiible in pure API). Maybe for someone it will be easy. I would be glad ;-)

If I will find soulution I will write this but my morale is very low now...

Upvotes: 1

Views: 134

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207465

You should be able to do this:

$img1->compositeImage( $img2, imagick::COMPOSITE_COPYOPACITY, 0, 0 );

$img1->compositeImage( $img2, imagick::COMPOSITE_MULTIPLY, 0, 0 );

Have a look at the documentation - here.

Upvotes: 2

Related Questions