Imagick Equivalent Of This Imagemagick Command?

房东的猫 提交于 2019-12-13 04:26:59

问题


I'm trying to create a vignette effect, and I can get desired result through command line. But when I try it with Imagick, I'm not getting the desired result

convert i.jpg ( -size 150x150 radial-gradient:black-white -gravity center -crop 100x100+0+0 +repage ) -compose multiply -flatten o.jpg

I tried the following Imagick commands

$gra = new Imagick();
$gra->newPseudoImage(150, 150, "radial-gradient:black-white");
$gra->cropThumbnailImage(100, 100);
$gra->setImagePage(100, 100, 0, 0);
$img = new Imagick("i.jpg");
$img->compositeImage($gra, Imagick::COMPOSITE_MULTIPLY, 0, 0);
$img->flattenImages();
$img->writeImage("o.jpg");

Thanks for any help!

来源:https://stackoverflow.com/questions/21248421/imagick-equivalent-of-this-imagemagick-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!