PHP Conference Japan 2024

Imagick::selectiveBlurImage

(PECL imagick 3 >= 3.3.0)

Imagick::selectiveBlurImage在對比度閾值內選擇性模糊影像

描述

public Imagick::selectiveBlurImage(
    float $radius,
    float $sigma,
    float $threshold,
    int $channel = Imagick::CHANNEL_DEFAULT
): bool

在對比度閾值內選擇性模糊影像。它類似於銳化遮罩,可以銳化超過特定閾值的所有對比度。

參數

radius

sigma

threshold

channel

提供對您的通道模式有效的任何通道常數。若要套用至多個通道,請使用位元運算子組合通道常數。預設為 Imagick::CHANNEL_DEFAULT。請參閱此通道常數列表

回傳值

成功時回傳 true

範例

範例 #1 Imagick::selectiveBlurImage()

<?php
function selectiveBlurImage($imagePath, $radius, $sigma, $threshold, $channel) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->selectiveBlurImage($radius, $sigma, $threshold, $channel);
header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

?>

新增註解

使用者貢獻註解

此頁面沒有使用者貢獻的註解。
To Top