PHP 8.3.4 Released!

Imagick::adaptiveThresholdImage

(PECL imagick 2, PECL imagick 3)

Imagick::adaptiveThresholdImage輝度の範囲にもとづいて各ピクセルの閾値を選択する

説明

public Imagick::adaptiveThresholdImage(int $width, int $height, int $offset): bool

周辺のピクセルの輝度の範囲にもとづいて、 各ピクセルの閾値を選択します。 画像全体の輝度のヒストグラムが特定の頂点を持っていない場合の閾値の設定が可能となります。

パラメータ

width

周辺の幅。

height

周辺の高さ。

offset

平均オフセット。

戻り値

成功した場合に true を返します。

例1 Imagick::adaptiveThresholdImage()

<?php
function adaptiveThresholdImage($imagePath, $width, $height, $adaptiveOffset) {
$imagick = new \Imagick(realpath($imagePath));
$adaptiveOffsetQuantum = intval($adaptiveOffset * \Imagick::getQuantum());
$imagick->adaptiveThresholdImage($width, $height, $adaptiveOffsetQuantum);
header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top