array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'imagick.linearstretchimage.php', 1 => 'Imagick::linearStretchImage', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.levelimage.php', 1 => 'Imagick::levelImage', ), 'next' => array ( 0 => 'imagick.liquidrescaleimage.php', 1 => 'Imagick::liquidRescaleImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/linearstretchimage.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::linearStretchImage — Stretches with saturation the image intensity
Stretches with saturation the image intensity.
blackPoint
The image black point
whitePoint
The image white point
成功时返回 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();
}
?>