This is the original image:
This is the image after I opened and showed it with Pillow:
The original image is JPEG, but I've tried changing the format to TIFF, PSD, but nothing works. I've tried converting the image to RGB, RGBA, CMYK, and can't see any improvement.
If I simply take a screenshot of the image, and open it in Pillow, the colours are preserved.
Then I thought I might not need Pillow, and I can use another library, and tried OpenCV, but the same thing happened! Same results as the picture above.
As @HansHirse suggested in the comments in my previous question, the post made me realise that when I just saving the image, the colours are preserved. (Though just opening and saving without using the ICC profile produces the exact image anyway.)
from PIL import Image
i = Image.open("/Users/shashwataryal/Downloads/Tom Ford Rodeo.jpeg")
##Colours are preserved when I just save the image immediately after opening.
i.save("/Users/shashwataryal/Downloads/1.jpeg")
##however, if I create a new image and paste my image I have the same issue.
##The image is very saturated. (not dull like in the question @HansHirse suggested in my previous post)
layer = Image.new('RGB', i.size, "#faf8f8")
layer.show()
layer.paste(i)
layer.show()
layer.save('/Users/shashwataryal/Downloads/1.jpeg',icc_profile=i.info.get('icc_profile'))
layer.save('/Users/shashwataryal/Downloads/2.jpeg',icc_profile=i.info.get('icc_profile'))
I'm trying to add the image to a new blank Pillow image and maybe add other images besides it as well. I can't figure out how to add the ICC profile to the new image. Will it affect other images if I paste them onto the new image created in Pillow?
My previous question was marked as a duplicate of:
Color gets dull: opencv cv2.imread cv2.imwrite
While this question is similar, it just deals with saving the image right after opening, and I have no issues saving it immediately after opening. My issue is saving it after pasting it onto a big blank canvas.