« Imagick::levelImage
Imagick::liquidRescaleImage »

Imagick::linearStretchImage

(PECL imagick 2, PECL imagick 3)

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

説明

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

?>

関連キーワード:
Imagick   imagick   画像   linearStretchImage   輝度   飽和   pixels   float   blackPoint   whitePoint   imagePath   blackThreshold   whiteThreshold   levelImage   liquidRescaleImage   成功   realpath   getImageWidth   getImageHeight   header   Content   Type   image   getImageBlob
関連する関数・ページ:
imagick.levelimage   imagick.getimagetype   imagick.getimagewidth   imagick.getimageheight   imagick.vignetteimage   imagick.tostring