Imagick::linearStretchImage
(PECL imagick 2.0.0)
Imagick::linearStretchImage — 画像の輝度を引き伸ばして飽和させる
説明
Imagick::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();
}
?>