【问题标题】:Using Python's PIL, how do I enhance the contrast/saturation of an image?使用 Python 的 PIL,如何增强图像的对比度/饱和度?
【发布时间】:2011-05-07 18:15:12
【问题描述】:

只是一个简单的对比度和饱和度增强。 没什么特别的。

【问题讨论】:

    标签: python algorithm image python-imaging-library


    【解决方案1】:

    因为 PIL 大部分时间都已经死了。改为安装 Pillow 前叉 sudo pip install pillow,并使用其 ImageEnhance 模块 http://pillow.readthedocs.org/en/3.0.x/reference/ImageEnhance.html

    >>> from PIL import Image, ImageEnhance
    >>> image = Image.open('downloads/jcfeb2011.jpg')
    >>> contrast = ImageEnhance.Contrast(image)
    >>> image.show()
    

    >>> contrast.enhance(2).show()
    

    【讨论】:

    • 这就是为什么你不应该只发布链接作为答案的原因......现在没用了......
    • 如果输入图像的对比度已经很好了怎么办?如何检测图像是否需要这个?
    • 那将是主观的,并且非常困难。无论如何,这应该是一个单独的问题。
    猜你喜欢
    • 2019-02-06
    • 1970-01-01
    • 1970-01-01
    • 2014-02-06
    • 1970-01-01
    • 1970-01-01
    • 2011-10-30
    • 1970-01-01
    • 2013-12-17
    相关资源
    最近更新 更多