HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Auto-level image

← autoGammaImage   autoOrient →
Adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.

Example 1

function autoLevelImage($image_path)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->autoLevelImage();
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}

Example 2

function autoOrientate($image_path)
{
    $imagick = new \Imagick(realpath("../images/orientation_test.tga"));
//    $imagick->autoOrient();
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}