📜  PHP |想象一下 linearStretchImage()函数

📅  最后修改于: 2022-05-13 01:56:42.931000             🧑  作者: Mango

PHP |想象一下 linearStretchImage()函数

Imagick::linearStretchImage()函数是PHP中的一个内置函数,用于以饱和度拉伸图像强度。 Imagick::linearStretchImage()函数的计算是同时用 blackPoint 和 whitePoint 的像素倍数进行的。

句法:

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

参数:该函数接受上面提到的两个参数,如下所述:

  • $blackPoint:此参数保存图像黑点。
  • $whitePoint:此参数保存图像白点。

返回值:此函数在成功时返回 TRUE,在失败时返回 FALSE。

下面的例子说明了PHP中的 Imagick::linearStretchImage()函数:

程序:该程序使用 Imagick::linearStretchImage()函数以饱和度拉伸图像强度。

getImageWidth() * $imagick->getImageHeight();
  
// Use linearStretchImage() function to stretches with
// saturation the image intensity
$imagick->linearStretchImage($blackThreshold * $pixels, $whiteThreshold * $pixels);
  
header("Content-Type: image/jpeg");
  
// Display the image
echo $imagick->getImageBlob();
  
?>

输出:

参考: https://www. PHP.net/manual/en/imagick.linearstretchimage。 PHP