Conversion from CMYK to RGB with Pillow is different from that of Photoshop

假如想象 提交于 2019-11-29 02:06:19

SOLVED

The problem is that Pillow does not know the input ICC profile, while photoshop had one set as default.

Photoshop use for

CMYK: U.S. Web Coated (SWOP) v2

RGB: sRGB IEC61966-2.1

So I've solved in this way:

img = Image.open('in.jpg')
img = ImageCms.profileToProfile(img, 'USWebCoatedSWOP.icc', 'sRGB Color Space Profile.icm', renderingIntent=0, outputMode='RGB')
img.save('out.jpg', quality=100)

On Windows the profiles can be found (if installed) in these folders:

C:\Windows\System32\spool\drivers\color\USWebCoatedSWOP.icc
C:\Program Files (x86)\Common Files\Adobe\Color\Profiles\Recommended\USWebCoatedSWOP.icc
C:\Program Files (x86)\Adobe\Acrobat DC\Resource\Color\Profiles\Recommended\USWebCoatedSWOP.icc

C:\Windows\System32\spool\drivers\color\sRGB Color Space Profile.icm
C:\Program Files (x86)\Common Files\Adobe\Color\Profiles\Recommended\sRGB Color Space Profile.icm
C:\Program Files (x86)\Adobe\Acrobat DC\Resource\Color\Profiles\Recommended\sRGB Color Space Profile.icm
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!