setImageBias is not working on a LAMP box

▼魔方 西西 提交于 2019-12-11 05:27:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!