<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Adjusts the contrast of an image</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagick.shearimage.html">Imagick::shearImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagick.sketchimage.html">Imagick::sketchImage</a></div> <div class="up"><a href="class.imagick.html">Imagick</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="imagick.sigmoidalcontrastimage" class="refentry"> <div class="refnamediv"> <h1 class="refname">Imagick::sigmoidalContrastImage</h1> <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::sigmoidalContrastImage</span> — <span class="dc-title">Adjusts the contrast of an image</span></p> </div> <div class="refsect1 description" id="refsect1-imagick.sigmoidalcontrastimage-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>Imagick::sigmoidalContrastImage</strong></span> ( <span class="methodparam"><span class="type">bool</span> <code class="parameter">$sharpen</code></span> , <span class="methodparam"><span class="type">float</span> <code class="parameter">$alpha</code></span> , <span class="methodparam"><span class="type">float</span> <code class="parameter">$beta</code></span> [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$channel</code><span class="initializer"> = Imagick::CHANNEL_DEFAULT</span></span> ] )</div> <p class="para rdfs-comment"> 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 <strong><code>TRUE</code></strong> to increase the image contrast otherwise the contrast is reduced. </p> <p class="para"> See also <a href="url.imagemagick.usage.color_mods.sigmoidal" class="link external">» ImageMagick v6 Examples - Image Transformations — Sigmoidal Non-linearity Contrast</a> </p> </div> <div class="refsect1 parameters" id="refsect1-imagick.sigmoidalcontrastimage-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <code class="parameter">sharpen</code></dt> <dd> <p class="para"> If true increase the contrast, if false decrease the contrast. </p> </dd> <dt> <code class="parameter">alpha</code></dt> <dd> <p class="para"> The amount of contrast to apply. 1 is very little, 5 is a significant amount, 20 is extreme. </p> </dd> <dt> <code class="parameter">beta</code></dt> <dd> <p class="para"> 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. </p> </dd> <dt> <code class="parameter">channel</code></dt> <dd> <p class="para"> Which color channels the contrast will be applied to. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-imagick.sigmoidalcontrastimage-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success. </p> </div> <div class="refsect1 examples" id="refsect1-imagick.sigmoidalcontrastimage-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4029"> <p><strong>Example #1 Create a gradient image using <span class="function"><strong>Imagick::sigmoidalContrastImage()</strong></span> suitable for blending two images together smoothly, with the blending defined by $contrast and $the midpoint </strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /><br /></span><span style="color: #007700">function </span><span style="color: #0000BB">generateBlendImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$width</span><span style="color: #007700">, </span><span style="color: #0000BB">$height</span><span style="color: #007700">, </span><span style="color: #0000BB">$contrast </span><span style="color: #007700">= </span><span style="color: #0000BB">10</span><span style="color: #007700">, </span><span style="color: #0000BB">$midpoint </span><span style="color: #007700">= </span><span style="color: #0000BB">0.5</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$imagick </span><span style="color: #007700">= new </span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br /> </span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-></span><span style="color: #0000BB">newPseudoImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$width</span><span style="color: #007700">, </span><span style="color: #0000BB">$height</span><span style="color: #007700">, </span><span style="color: #DD0000">'gradient:black-white'</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$quanta </span><span style="color: #007700">= </span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-></span><span style="color: #0000BB">getQuantumRange</span><span style="color: #007700">();<br /> </span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-></span><span style="color: #0000BB">sigmoidalContrastImage</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">, </span><span style="color: #0000BB">$contrast</span><span style="color: #007700">, </span><span style="color: #0000BB">$midpoint </span><span style="color: #007700">* </span><span style="color: #0000BB">$quanta</span><span style="color: #007700">[</span><span style="color: #DD0000">"quantumRangeLong"</span><span style="color: #007700">]);<br /><br /> return </span><span style="color: #0000BB">$imagick</span><span style="color: #007700">; <br />}<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 errors" id="refsect1-imagick.sigmoidalcontrastimage-errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para"> Throws ImagickException on error. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagick.shearimage.html">Imagick::shearImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagick.sketchimage.html">Imagick::sketchImage</a></div> <div class="up"><a href="class.imagick.html">Imagick</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>