Imagick::thresholdImage
(PECL imagick 2, PECL imagick 3)
Imagick::thresholdImage — 閾値にもとづいて個々のピクセルの値を変更する
説明
public Imagick::thresholdImage
( float $threshold
[, int $channel
= Imagick::CHANNEL_DEFAULT
] ) : bool
個々のピクセルの輝度を閾値と比較し、その色を変更します。 変換結果は、コントラストの高い 2 色の画像となります。
パラメータ
threshold
channel
返り値
成功した場合に true
を返します。
例
例1 Imagick::thresholdImage()
<?phpfunction thresholdimage($imagePath, $threshold, $channel) { $imagick = new \Imagick(realpath($imagePath)); $imagick->thresholdimage($threshold * \Imagick::getQuantum(), $channel); header("Content-Type: image/jpg"); echo $imagick->getImageBlob();}?>