简体   繁体   中英

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...

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM