Imagick::linearStretchImage

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

説明

public bool Imagick::linearStretchImage(float $blackPoint, float $whitePoint)

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

パラメータ

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();
}

?>