Open In App

PHP | Imagick autoLevelImage() Function

Last Updated : 26 Aug, 2019
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report
The Imagick::autoLevelImage() function is an inbuilt function in PHP which is used to adjusts the levels of a particular image channel. The level of the image channel is set the minimum and maximum value of color in the full quantum range. Syntax:
bool Imagick::autoLevelImage( $channel )
Parameters: This function accepts a single parameters $channel which is used to set the auto-levelling. Return Value: This function returns True on success. Below programs illustrate the Imagick::autoLevelImage() function in PHP: Program 1: php
<?php

// Create an image object
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png');

// Set the autolevelling of image
$imagick->autoLevelImage();

// Display the image
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
?>
Output: auto level image Program 2: php
<?php

// Create an image object
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/slider.gif');

// Set the autolevelling of image
$imagick->autoLevelImage();

// Display the image
header("Content-Type: image/gif");
echo $imagick->getImageBlob();
?>
Output: auto level image Related Articles: Reference: http://php.net/manual/en/imagick.autolevelimage.php

Next Article
Practice Tags :

Similar Reads