0

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!

  • Why not use [Imagick::vignetteImage](http://www.php.net/manual/en/imagick.vignetteimage.php)? Seems like this is extra work, as your not doing any custom effects. – emcconville Jan 21 '14 at 12:14
  • Well, vignetteImage doesnt seem to allow any customizations – user1545997 Jan 22 '14 at 01:26
  • There is a package dedicated to composing images with filters and layers. The package is called [pslayers](https://github.com/darrynten/pslayers) and we use it in production on a few of our apps. – darryn.ten Mar 28 '18 at 22:29

0 Answers0