PHP - Manual: Imagick::vignetteImage
2024-12-22
(PECL imagick 2, PECL imagick 3)
Imagick::vignetteImage — Adds vignette filter to the image
$blackPoint
,$whitePoint
,$x
,$y
Softens the edges of the image in vignette style. 此方法在Imagick基于ImageMagick 6.2.9以上版本编译时可用。
blackPoint
The black point.
whitePoint
The white point
x
X offset of the ellipse
y
Y offset of the ellipse
成功时返回 true
。
示例 #1 Imagick::vignetteImage()
<?php
function vignetteImage($imagePath, $blackPoint, $whitePoint, $x, $y) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->vignetteImage($blackPoint, $whitePoint, $x, $y);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>
官方地址:https://www.php.net/manual/en/imagick.vignetteimage.php