HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Brightness contrast image

← borderImage   cannyEdgeImage →
Change the brightness and/or contrast of an image. It converts the brightness and contrast parameters into slope and intercept and calls a polynomical function to apply to the image.

Example

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