使用pgmagick在Python中调整图像级别

时间:2018-04-24 13:54:39

标签: python graphicsmagick pgmagick

我正在尝试使用pgmagick在Windows 7,Python 3.5.1上调整图像级别。

我提出的所有变化要么最终得到几乎完全白色的图像,要么出现以下错误:

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    im.level('48%,0.5,52%')
Boost.Python.ArgumentError: Python argument types in
    Image.level(Image, str)
did not match C++ signature:
    level(class Magick::Image {lvalue}, double, double, double)

我还在Photoshop上测试了我的关卡设置,因此它们有意义并且不会产生白色图片。这是我的代码:

from pgmagick import Image

im = Image('image.jpg')
im.level('48%,0.5,52%')       # not working
# im.level('48%', 0.5, '52%') # not working
# im.level(48,0.5,52)         # no error but picture almost completely white

请注意,我可以使用运行以下代码的Node.js调整图像级别:

gm('image.jpg')
.level('48%', 0.5, '52%')

非常感谢任何帮助和想法!

0 个答案:

没有答案