【发布时间】:2016-02-15 19:55:29
【问题描述】:
我能够将图像从 RGB 色彩空间转换为 HSV 颜色空间,但是如何使用 PIL documentation 中所述的 HSV 比例来操作这些值?
img = Image.open("assets/image.png")
img = img.convert('HSV')
img.show()
【问题讨论】:
-
嗨迈克尔,您想将像素的各个值更改为您选择的任意值吗?如果是这样,您想要的是 Image.putpixel ,您可以在其中传递像素的坐标和您想使用的值pillow.readthedocs.org/en/3.1.x/reference/Image.html
-
嗨@BenJ,我可能会混淆 HSV 和 HSL,但我想将图像视为在 PhotoShop 中并根据 HSV/HSL 值对其进行操作。
-
我不是 100% 清楚你究竟想要达到什么目的,但如果你需要改变像素值 putpixel 是要走的路。此文档pillow.readthedocs.org/en/3.1.x/reference/Image.html 非常有用,可能包含您所追求的内容
标签: python python-2.7 python-imaging-library pillow