©
本文档使用 PHP中文网手册 发布
(PECL imagick 2.0.0)
Imagick::setImageBias — Sets the image bias for any method that convolves an image
$bias
)Sets the image bias for any method that convolves an image (e.g. Imagick::ConvolveImage()).
bias
成功时返回 TRUE
。
错误时抛出 ImagickException。
Example #1 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 ();
}
?>