php Imagick::levelImage 用法

发布于 2024-10-09 07:21:30 字数 564 浏览 0 评论 0原文


我已经很努力了,但无法使这个方法正常工作。
使用格式是

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 方法的示例,因此需要帮助!
也许有人有一个很好的工作示例,请帮助我:)

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 ] );

I try use it like

$img->levelImage (0, 1.0, 255);

and

$img->levelImage (255, 1.0, 0);

or even like

$img->levelImage (-0.5, 1.0, 5.6);

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:)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴梦一场 2024-10-16 07:21:30

查看 LevelImage 的 ImageMagick 文档:

指定黑色和
白点的范围为
0-QuantumRange,伽玛有
范围0-10

因此,来自 PHP 的合理调用可能如下所示:

//bool Imagick::levelImage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Imagick::CHANNEL_ALL ] )
$img->levelImage (20, 5, 220);

我猜测 QuantumRange 设置为 255,如果没有,请尝试调用 Imagick::getQuantumRange 了解它是什么。

如果它仍然不起作用,我将通过编写示例代码来找出问题所在。

Looking at the ImageMagick documentation for LevelImage:

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

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);

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文