php imagick的:: levelImage用法 [英] php Imagick::levelImage usage

查看:140
本文介绍了php imagick的:: levelImage用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经尽力了,但是无法使这种方法正常工作.
用法格式为


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:

指定黑色和黑色的级别 白点的范围为 0-QuantumRange,并且gamma具有 范围0-10

Specify the levels where the black and white points have the range of 0-QuantumRange, and gamma has the range 0-10

因此来自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,如果没有设置,请尝试调用

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用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆