Andrew Murray

Results 761 comments of Andrew Murray

It turns out that this situation is more complicated. See https://github.com/python-pillow/Pillow/pull/3838#discussion_r292114051

When I inspect the image with `exiftool -v`, I see that sample2.NEF has an image that is 160x120. However, I also see that it has [child images](https://www.awaresystems.be/imaging/tiff/tifftags/subifds.html) - two reduced...

It turns out that even with support for child images, the files provided here fail to load. sample.dng has five child images. One of the child images fails to load...

I've created PR #6569 to add reading of TIFF child images.

What format would you like to save your image as? PNG?

The following code will let you save an image with an sRGB profile. ```python from PIL import Image, ImageCms im = Image.new("RGB", (1, 1)) profile = ImageCms.createProfile("sRGB") im.save("out.jpg", icc_profile=ImageCms.ImageCmsProfile(profile).tobytes()) ```...

Try this. ```python import io from PIL import Image, ImageCms current_image = Image.open("out.jpg") profile = current_image.info.get("icc_profile") print(ImageCms.getProfileName(io.BytesIO(profile))) ``` With the file I created earlier, it prints ``` sRGB built-in ```

If you're asking how to apply an sRGB profile to an image with a different profile, that sounds like [`ImageCms.profileToProfile()`](https://pillow.readthedocs.io/en/stable/reference/ImageCms.html#PIL.ImageCms.profileToProfile). ```python import io from PIL import Image, ImageCms current_image =...

[`ImageCms.buildTransformFromOpenProfiles()`](https://pillow.readthedocs.io/en/stable/reference/ImageCms.html#PIL.ImageCms.buildTransformFromOpenProfiles) returns an instance of `ImageCmsTransform`, not a profile. If you're trying to save the image with an sRGB profile, then you could change your last line to ```python current_image.save("out2.jpg",...