Imagick::setImageBias

(PECL imagick 2.0.0)
Sets the image bias for any method that convolves an image
bool Imagick::setImageBias ( float $bias )

Sets the image bias for any method that convolves an image (e.g. Imagick::ConvolveImage()).

Parameters:
bias

Sets the image bias for any method that convolves an image (e.g. Imagick::ConvolveImage()).

Returns:

Returns TRUE on success.

Exception:

Throws ImagickException on error.

Examples:
Imagick::setImageBias()
<?php
//requires ImageMagick version 6.9.0-1 to have an effect on convolveImage
function setImageBias($bias) {
    $imagick = new \Imagick(realpath("images/stack.jpg"));

    $xKernel = array(
        -0.70, 0, 0.70,
        -0.70, 0, 0.70,
        -0.70, 0, 0.70
    );

    $imagick->setImageBias($bias * \Imagick::getQuantum());
    $imagick->convolveImage($xKernel, \Imagick::CHANNEL_ALL);

    $imagick->setImageFormat('png');
    
    header('Content-type: image/png');
    echo $imagick->getImageBlob();
}

?>

doc_php
2016-02-24 16:01:19
Comments
Leave a Comment

Please login to continue.