1

How want to apply a vignette effect to an image using PHP with ImageMagik. I found this function but I'm not sure how to use it.

Imagick::vignetteImage

Thanks for your help!

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
James
  • 103
  • 1
  • 1
  • 13

2 Answers2

1

Correct answer: read the docs.

Rijk
  • 11,032
  • 3
  • 30
  • 45
  • The PHP page for [Imagick::vignetteImage](http://php.net/manual/en/imagick.vignetteimage.php) seems to reflect the correct params. Not sure if it was updated after this answer was posted or what, but the param list above is not correct. Here's a relevant discussion: http://stackoverflow.com/questions/17846665/black-color-of-imagemagick-vignette – Jake Bathman Sep 23 '15 at 12:43
0

Assuming you have the correct version of Image Magick and the PHP library installed:

<?php
    $image = new Imagick();
    $image->readImage($in);
    $image->vignetteImage ( float $blackPoint , float $whitePoint , int $x , int $y )
    $image->writeImage($out);
?>
Mat
  • 157
  • 11