python - 使用 pgmagick 在 Python 中调整图像级别
问题描述
我正在尝试在 Windows 7、Python 3.5.1 上使用 pgmagick 调整图像级别。
我提出的所有变体要么以几乎完全白色的图像结束,要么出现以下错误:
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%')
非常感谢任何帮助和想法!
解决方案
推荐阅读
- java - 在 Android Studio 3.1.3 中构建 gradle 失败
- javascript - JS-Data addAction 方法抛出而不是拒绝带有错误消息的承诺
- react-native - 使用远程 MacBook 使用 XCode 构建 React Native 应用程序
- google-chrome-extension - 来自 chrome 扩展的调度事件清除事件数据传输
- python-3.x - 如何将包含 nan 的单元格的值更改为另一个特定值?
- sql - 在 sql 中对具有状态的实体进行建模,其中实体在推进状态时具有更多属性(休眠)
- python - 在 C++ 和 Python 程序中使用命名管道的 IPC 挂起
- python - xarray select\interpolate custom 1D slice out auf 多维数据(又名 zip 与 itertools.product)
- vbscript - 如何使用 VBS 创建 exe 文件
- android - 如何在博览会中获得旧证书并退出新的 apk?