问题描述
我已经尽力了,但是无法使这种方法正常工作.
用法格式为
I have trying hard, but can't make this method works properly.
The usage format is
Imagick::levelImage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Imagick::CHANNEL_ALL ] );
我尝试像
$img->levelImage (0, 1.0, 255);
和
$img->levelImage (255, 1.0, 0);
甚至喜欢
$img->levelImage (-0.5, 1.0, 5.6);
但没有成功.
输出图像几乎是黑色或几乎是白色.
我使用的所有其他imagick方法都可以正常工作,但这只是我的后盾))
我在网上找不到任何使用此imagick方法的示例,因此需要帮助!
也许有人有一个很好的工作例子,请帮我:)
but without any success.
Output image is either almost black or almost white.
All other imagick methods I use work fine, but this one is just a back-breaker for me))
I can't find any examples of usage this imagick method on the net so need help!
Maybe somebody have an good working example, help me please:)
推荐答案
查看ImageMagick文档中的 LevelImage :
Looking at the ImageMagick documentation for LevelImage:
因此来自PHP 可能的明智调用如下所示:
So a sensible call from PHP might look like this:
//bool Imagick::levelImage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Imagick::CHANNEL_ALL ] )
$img->levelImage (20, 5, 220);
我猜测QuantumRange设置为255,如果没有设置,请尝试调用 Imagick :: getQuantumRange 找出它是什么.
I'm guessing the QuantumRange is set at 255, if not, try calling Imagick::getQuantumRange to find out what it is.
如果仍然无法正常工作,我将通过编写示例代码来找出问题所在.
If it still doesn't seem to work, I'll figure out what's wrong by writing example code.
这篇关于php imagick的:: levelImage用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!