array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'imagick.autolevelimage.php', 1 => 'Imagick::autoLevelImage', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.appendimages.php', 1 => 'Imagick::appendImages', ), 'next' => array ( 0 => 'imagick.averageimages.php', 1 => 'Imagick::averageImages', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/autolevelimage.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 3 >= 3.3.0)
Imagick::autoLevelImage — Adjusts the levels of a particular image channel
Adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.
channel
Which channel should the auto-levelling should be done on.
Returns true
on success.
Example #1 Imagick::autoLevelImage()
<?php
function autoLevelImage($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->autoLevelImage();
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>