有什么方法可以在 python ImageMagick 绑定(bind)中使用 ICC 将 RGB 图像转换为 CMYK 图像。我知道您可以在命令行中轻松完成它,但是无论如何可以在像 Wand(最好是 Wand)这样的绑定(bind)中完成它吗?我现在拥有的是:
from wand.image import Image
from urllib.request import urlopen
response = urlopen('https://www.website.com/path/to/image.jpg')
try:
with Image(file=response) as img:
img.type = 'truecolor'
img.alpha_channel = True
img = img.colorspace = 'cmyk'
img.save(filename='converted.jpg')
finally:
response.close()
这会导致图像的颜色非常不准确,但颜色空间正确。有什么方法可以使用配置文件进行转换吗?谢谢。
最佳答案
尝试使用 wand.image.Image.transform_colorspace
with Image(file=response) as img:
img.transform_colorspace('cmyk')
img.save(filename='converted.jpg')
关于python - ImageMagick - 在 Python 中使用 ICC 将图像 RGB 转换为 CMYK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46638393/