Imagick::whiteThresholdImage
(PECL imagick 2, PECL imagick 3)
Imagick::whiteThresholdImage — 閾値に満たないすべてのピクセルを白にする
説明
public Imagick::whiteThresholdImage
( mixed $threshold
) : bool
Imagick::thresholdImage() と似ていますが、 これは閾値に満たないピクセルをすべて白にし、その他のピクセルはそのままにします。
パラメータ
threshold
返り値
成功した場合に true
を返します。
変更履歴
バージョン | 説明 |
---|---|
PECL imagick 2.1.0 | 色を表す文字列をパラメータとして指定できるようになりました。
これまでのバージョンでは ImagickPixel オブジェクトしか指定できませんでした。 |
例
例1 Imagick::whiteThresholdImage()
<?phpfunction whiteThresholdImage($imagePath, $color) { $imagick = new \Imagick(realpath($imagePath)); $imagick->whiteThresholdImage($color); header("Content-Type: image/jpg"); echo $imagick->getImageBlob();}?>