PHP | Imagick autoLevelImage() Function

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 image channel is set the minimum and maximum value of color in full quantum range.

Syntax:

bool Imagick::autoLevelImage( $channel )

Parameters: This function accepts 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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create an image object
$imagick = new Imagick(
  
// Set the autolevelling of image
$imagick->autoLevelImage();
  
// Display the image
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
?>

chevron_right


Output:
auto level image

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create an image object
$imagick = new Imagick(
  
// Set the autolevelling of image
$imagick->autoLevelImage();
  
// Display the image
header("Content-Type: image/gif");
echo $imagick->getImageBlob();
?>

chevron_right


Output:
auto level image

Related Articles:

Reference: http://php.net/manual/en/imagick.autolevelimage.php



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.