Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,25 @@ def load_image(self, image):
image_path = folder_paths.get_annotated_filepath(image)

img = node_helpers.pillow(Image.open, image_path)
import io
from PIL import ImageCms

try:
if "icc_profile" in img.info:
icc_bytes = img.info["icc_profile"]

src_profile = ImageCms.ImageCmsProfile(io.BytesIO(icc_bytes))
dst_profile = ImageCms.createProfile("sRGB")

img = ImageCms.profileToProfile(
img,
src_profile,
dst_profile,
outputMode="RGB"
)
except Exception as e:
print("Icc color profile conversion failed:",e)


output_images = []
output_masks = []
Expand Down