Open In App

PHP | Imagick sigmoidalContrastImage() Function

The Imagick::sigmoidalContrastImage() function is an inbuilt function in PHP which is used to adjust the contrast of an image with a non-linear sigmoidal contrast algorithm.

Syntax:



bool Imagick::sigmoidalContrastImage( bool $sharpen, float $alpha,
                 float $beta, int $channel = Imagick::CHANNEL_DEFAULT)

Parameters: This function accepts four parameters as mentioned above and described below:

Return Value: This function returns TRUE on success.



Exceptions: This function throws ImagickException on error.

Below programs illustrate the Imagick::sigmoidalContrastImage() function in PHP:

Program 1:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Adjust the contrast
$imagick->sigmoidalContrastImage(true, 10, 32000);
  
// Show the output
header("Content-Type: image/png");
echo $imagick->getImageBlob();
?>

Output:

Program 2:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Adjust the contrast
$imagick->sigmoidalContrastImage(false, 10, 31000);
  
// Show the output
header("Content-Type: image/png");
echo $imagick->getImageBlob();
?>

Output:

Reference: https://www.php.net/manual/en/imagick.sigmoidalcontrastimage.php


Article Tags :