array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'imagick.sigmoidalcontrastimage.php', 1 => 'Imagick::sigmoidalContrastImage', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.shearimage.php', 1 => 'Imagick::shearImage', ), 'next' => array ( 0 => 'imagick.sketchimage.php', 1 => 'Imagick::sketchImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/sigmoidalcontrastimage.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::sigmoidalContrastImage — Adjusts the contrast of an image
$sharpen
,$alpha
,$beta
,$channel
= Imagick::CHANNEL_DEFAULT
Adjusts the contrast of an image with a non-linear sigmoidal contrast
algorithm. Increase the contrast of the image using a sigmoidal transfer
function without saturating highlights or shadows. Contrast indicates
how much to increase the contrast (0 is none; 3 is typical; 20 is
pushing it); mid-point indicates where midtones fall in the resultant
image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to
true
to increase the image contrast otherwise the contrast is reduced.
See also » ImageMagick v6 Examples - Image Transformations — Sigmoidal Non-linearity Contrast
sharpen
If true increase the contrast, if false decrease the contrast.
alpha
The amount of contrast to apply. 1 is very little, 5 is a significant amount, 20 is extreme.
beta
Where the midpoint of the gradient will be. This value should be in the range 0 to 1 - mutliplied by the quantum value for ImageMagick.
channel
Which color channels the contrast will be applied to.
Retorna true
em caso de sucesso.
Lança uma exceção ImagickException em caso de erro.
Exemplo #1 Create a gradient image using Imagick::sigmoidalContrastImage() suitable for blending two images together smoothly, with the blending defined by $contrast and $the midpoint
<?php
function generateBlendImage($width, $height, $contrast = 10, $midpoint = 0.5) {
$imagick = new Imagick();
$imagick->newPseudoImage($width, $height, 'gradient:black-white');
$quanta = $imagick->getQuantumRange();
$imagick->sigmoidalContrastImage(true, $contrast, $midpoint * $quanta["quantumRangeLong"]);
return $imagick;
}
?>