-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resized Display P3 image includes Display P3 color profile but it is missing color information #2862
Comments
Hi, it looks like GitHub has removed the ICC profiles from these images. Are you able to upload/provide the images via another service? Since libvips/libvips#2190 libvips v8.11.3 (and therefore sharp v0.29.0) allows .pipelineColorspace("rgb16")
.withMetadata({ icc: "p3" }) |
Hi @lovell, I tried your suggestion of using the built-in p3 profile and still got the same result. Here is the image with the sP3C profile attached, uploaded to imgur: https://i.imgur.com/LYriNZI.png The relevant code is:
Where iccProfile is "p3". For reference, this is the source image loaded from S3 into data.Body in the Display P3 color space, also uploaded to imgur https://i.imgur.com/Fa97cRx.png. |
Thanks, and sorry you were correct, the P3 profile is present in the GitHub image (I was looking at a previously downloaded image from a different issue with a very similar filename, d'oh). I can reproduce the problem locally, and will need to spend a little time to debug exactly what's happening. In terms of the built-in "p3" profile in libvips, this is DisplayP3, which is hopefully the more useful/common flavour. |
Sounds good, thanks for taking a look! I know libvips is capable of applying these profiles correctly because, on upload, I use libvips from Go to apply the Display P3 and sRGB profiles to the uploaded images before storing them in S3. I'm using the vips_icc_transform API to go from their embedded icc profiles to one of the profiles I supply. (I normalize wide-color images from Adobe RGB, ProPhoto etc to Display P3, and RGB images to sRGB IEC61966-2.1 to ensure maximum compatibility.) |
Commit 104464c fixes this and adds a test that would previously have failed. This will be in v0.29.1 - thanks for reporting! |
Awesome! Thanks so much! I'll test out the fix when I have some time. |
Hi @lovell - I finally had a chance to pull this change and try it out.
It's possible this is due to how I installed it - I ran: Is there another way I should be installing it? Or could you push like a pre-release version of it? The relevant code from my lambda function is:
Where iccProfile is "p3". |
Please can you try adding the
|
Awesome! Everything seems to be working now. Thanks for all your help! |
Thanks for checking, I'll re-open this until v0.29.1 is released with the fix. |
v0.29.1 is now available - thank you for reporting this. |
I'm working on adding wide color support to my application.
I've got my pipeline from device -> server -> Amazon S3 working and I can successfully upload images with the Display P3 color profile from device to S3 without a loss of color information, retaining the color profile. I use libvips on my Go server as well, in order to do some initial processing.
Once the images are stored in S3, I have Sharp running in a Lambda function for Cloudfront origin requests to the S3 bucket. I have verified that a vanilla Cloudfront distribution is able to serve the wide color images correctly, but when they pass through Sharp resizing they lose color information.
I'm on the latest version, v0.29, and I'm using the attached canary image to test (it is an image that shows up in Display P3 but disappears in sRGB).
If you download and inspect the images, you can see that the resulting image has the Display P3 profile but it has lost the color information.
I'm using the pipelineColorspace("rgb16") operator, and specifying the output icc profile. Is there something else I'm doing wrong here? Thanks!
Relevant code:
The text was updated successfully, but these errors were encountered: