Imagick::linearStretchImage

(PECL imagick 2, PECL imagick 3)

Imagick::linearStretchImage画像の輝度を引き伸ばして飽和させる

説明

publicImagick::linearStretchImage(float$blackPoint, float$whitePoint): bool

画像の輝度を引き伸ばして飽和させます。

パラメータ

blackPoint

画像の黒の点。

whitePoint

画像の白の点。

戻り値

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

例1 Imagick::linearStretchImage()

<?php
function linearStretchImage($imagePath, $blackThreshold, $whiteThreshold) {
$imagick = new \Imagick(realpath($imagePath));
$pixels = $imagick->getImageWidth() * $imagick->getImageHeight();
$imagick->linearStretchImage($blackThreshold * $pixels, $whiteThreshold * $pixels);

header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

?>
To Top