Friday, October 17, 2025
HomeLanguagesPHP | Imagick autoLevelImage() Function

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 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
  
// 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();
?>


Output:
auto level image

Program 2:




<?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();
?>


Output:
auto level image

Related Articles:

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

RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS