为什么.tif不在AdobeRGB colorprofile中导出,而.jpg是

2024-10-01 11:34:58 发布

您现在位置:Python中文网/ 问答频道 /正文

对于该项目,我正在PyCharm中使用Python 3.8和以下库: 枕头,操作系统和配置解析器

我一直在尝试将图像转换为colorprofile AdobeRGB,我想我终于成功了,但它似乎只适用于.jpg文件,而不适用于.tif文件。而我也在为他们俩做同样的事。有人知道我做错了什么吗

我正在使用的代码:

backplate = config['BACKPLATE']['backplate']
backplate1 = Image.open(backplate)
icc_adobe = backplate1.info.get('icc_profile')

for versie, render, nameMin in zip(fileVersion, renders, fileNameMin):
    os.chdir(path + '\\' + versie)
    path = os.getcwd()

    imageAdobe_tif = Image.open(render)
    imageAdobe_tif = imageAdobe_tif.save(path + '\\' + nameMin + '.tif', icc_profile=icc_adobe)
    imageAdobe_jpg = Image.open(render)
    imageAdobe_jpg = imageAdobe_jpg.save(path + '\\' + nameMin + '.jpg', icc_profile=icc_adobe)

    path = os.path.dirname(path)

Tags: 文件pathimageosopenrenderprofileadobe
2条回答

核武器中的sRGB与Adobe RGB

sRGB gives better, more consistent, results and the same, or brighter, colours. Using Adobe RGB is one of the leading causes of colours not matching between monitor and print (however, you won't print, I guess). sRGB is the world's default color space. Use it and everything looks great everywhere, all the time.

这里有一个代码:

import nuke

selected_nodes = nuke.selectedNodes()

for node in selected_nodes:
    if node.Class() == "Read":
        node.knob("colorspace").setValue("sRGB")

node.knob("colorspace").value()

有人知道我做错了什么吗

我还没弄明白。我试图创建第二个变量来获取背景的icc_配置文件,并用它保存.tif,但不幸的是,这不起作用

相关问题 更多 >