我编写了一个 Python 应用程序,我需要在其中执行一些图像任务。
我正在尝试 PIL,它是 ImageOps 模块。但看起来 unsharp_mask 方法不能正常工作。它应该返回另一个图像,但返回一个 ImagingCore 对象,我不知道它是什么。
这是一些代码:
import Image
import ImageOps
file = '/home/phius/test.jpg'
img = Image.open(file)
img = ImageOps.unsharp_mask(img)
#This fails with AttributeError: save
img.save(file)
我坚持这一点。
我需要什么:能够做一些像 PIL 那样的图像 tweeksautocontrast
以及unsharp_mask
在控制质量水平的 jpg 中重新调整大小、旋转和导出的能力。