问题
I have this code:
<?php
$image = new Imagick(__DIR__ . DIRECTORY_SEPARATOR . '__stack__.jpg');
$image->medianFilterImage(2);
$image->setColorspace(Imagick::COLORSPACE_GRAY);
$image->medianFilterImage(2);
$xKernel = array(-0.70,0,0.70,-0.70,0,0.70,-0.70,0,0.70);
$max = $image->getQuantumRange();
$max = $max["quantumRangeLong"];
$image->setImageBias(0.50 * $max); // -bias 50%
$image->convolveImage($xKernel, Imagick::CHANNEL_ALL);
header('Content-type: image/jpeg');
echo $image;
Which I'm running under a WAMP box and under a LAMP box. Local/Production, respectively.
Both are running imagick 3.1.2.
LAMP's imagemagick version is: ImageMagick 6.8.8-7 Q16 x86_64
WAMP's imagemagick version is: ImageMagick 6.7.7-0 Q16
LAMP box won't run setImageBias properly and ends up with this result:
WAMP box gives the intended result though:
I couldn't find any information about setImageBias() being buggy nor any change about -bias
on imagemagick's changelog between those versions.
I think I'm doing it the proper way - calling it before convolving an image - but I don't know why this isn't working on my LAMP box.
__stack__.jpg
:
来源:https://stackoverflow.com/questions/24184801/setimagebias-is-not-working-on-a-lamp-box