我有以下脚本ImageMagick脚本
convert $tmpA4 \
\( -clone 0 -negate \) \
\( -size ${wd}x${ht} gradient: -negate \) \
-compose over -composite \
$tmpA4
我试图使用Imagick进行再生,但最终没有运气。请找到我尝试过的代码
$negate = clone($tmpA4);
$negate->negateImage(false);
file_put_contents("negateR.png",$negate);
$gradient = new Imagick();
$gradient->newPseudoImage(round($wd),round($ht), "gradient:white-black");
$gradient->setImageFormat("png");
$gradient->negateImage(false);
file_put_contents("gradientR.png",$gradient);
$negate->setImageAlphaChannel(imagick::ALPHACHANNEL_OPAQUE);
$negate->compositeimage($gradient, Imagick::COMPOSITE_COPYOPACITY , 0, 0);
$tmpA4->setImageCompose(imagick::COMPOSITE_OVER);
$tmpA4->compositeimage($negate, Imagick::COMPOSITE_OVER, 0, 0);
negateR.png和gradientR.png完美地生成了,但是最终的合成却没有。