-
Notifications
You must be signed in to change notification settings - Fork 460
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
Preserve image ICC profiles #2957
Preserve image ICC profiles #2957
Conversation
…with wide gamut displays, e.g., Retina iMacs.
Those images may just happen to look better on your system. But ICC color
profiles are often broken on the web. Many browsers render those images
incorrectly. PNG optimizers also like to remove them. (And getting my Mac
to display reasonable colors on an external monitor was fun.) My opinion is
👎 for this PR.
…--
Chris Warrick <https://chriswarrick.com/>
On Jan 27, 2018 23:14, "Mitch Chapman" ***@***.***> wrote:
This improves appearance of images on systems with wide gamut displays,
e.g., Retina iMacs.
Pull Request Checklist
- I’ve read the guidelines for contributing
<https://github.com/getnikola/nikola/blob/master/CONTRIBUTING.rst>.
- I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial)
and documentation (if applicable).
- I tested my changes.
Description
Images served by 'nikola serve -b' looked flat on my iMac with retina
display in comparison to the corresponding original images. Interactive
testing with Pillow's Image.open and Image.save revealed that it did not
automatically copy 'icc_profile' image info.
If it would be better for me to open an issue in the python-pillow/Pillow
project, please let me know. Thanks!
See the mention of available options for https://pillow.readthedocs.io/
en/latest/reference/Image.html#PIL.Image.Image.save <http://Image.save>.
------------------------------
You can view, comment on, or merge this pull request online at:
#2957
Commit Summary
- Preserve image ICC profile; improves appearance of images on systems
with wide gamut displays, e.g., Retina iMacs.
File Changes
- *M* nikola/image_processing.py
<https://github.com/getnikola/nikola/pull/2957/files#diff-0> (5)
Patch Links:
- https://github.com/getnikola/nikola/pull/2957.patch
- https://github.com/getnikola/nikola/pull/2957.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2957>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAT-m3gtNN9SPahjVsqS2M1gIo_cutOLks5tO5_UgaJpZM4RveGb>
.
|
Current recommended practice seems to be to embed color profiles when exporting images for the web. Most desktop web browsers now support ICC profile management. See the links below. The images of concern to me are JPEG photos that embed either sRGB (e.g., "sRGB IEC61966-2.1") or wide-gamut ("Display P3") color profiles. I've done follow-up tests to better understand cases in which such images render poorly. In case it's of use to anyone, here's what I've found. The tests encompassed:
In all cases, one image looked flat in comparison to the others: the "no profile" image created from the "Display P3" image. So, at least for my use case, a workaround for the current release of Nikola is to use only JPEG images exported with an embedded sRGB profile. Links
|
This sRGB PNG bug is still present in Firefox, and there is also an unrelated example of a JPEG that doesn’t work properly in Firefox at the end of this thread: https://bugzilla.mozilla.org/show_bug.cgi?id=621474 Removing the color profile fixes the sample PNGs shown in the thread. (They work fine in Chrome and Safari. Compared with Digital Color Meter.app.) While this might work better for JPEG and wide color gamuts, it might also hinder standard gamut PNG support in some cases. |
Here is a bit more detail about those test cases: The Firefox JPEG image cited (https://drive.google.com/file/d/0B_yEbP1sy9ScX09CYS1UaGxyWWs/view?usp=sharing) contains a CanonEOS5DMk2-Generic color profile. On macOS 10.13.3, Digital Color Meter.app 5.11 shows the PNG image data (https://bugzilla.mozilla.org/show_bug.cgi?id=621474) are presented in the same way by Safari 11.0.3, Chrome 64.0.3282.119 and Firefox 58.0, with one exception: in Firefox, the sample values for the "none" (i.e., untagged) PNG image data exactly match the original hex color values - Firefox renders them without applying the system display profile. |
Hmmm ... so, executive summary? This is a good idea for jpeg but not for png? |
Some browsers (Firefox) still have issues with color profile support. (That didn’t change since about 2011.) At the same time, a color profile can improve the appearance of images on wide color gamut displays (such as the ones found in newer Apple hardware). |
Your executive summary and Chris's follow-up look good to me. |
Perhaps this could be an optional setting? @mchapman87501, can you make it so ICC profiles are preserved only when the user asks for it via settings? |
Making it an option should not be terribly hard. If @mchapman87501 can't/won't I can hack it |
I'll be happy to make the changes. It may be a day or two before I have time, if that's ok. |
Take your time!
…On Thu, Feb 1, 2018, 1:08 AM Mitch Chapman ***@***.***> wrote:
I'll be happy to make the changes. It may be a day or two before I have
time, if that's ok.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2957 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAGK7vRwbi4dHeONArKdnA_DloGtiXqks5tQTiigaJpZM4RveGb>
.
|
…profiles when copying galleries and post images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Thanks for contributing, and especially for improving test coverage! 🎉 You may want to add the e-mail used for the original commit (***-8.com) to your GitHub profile so it will appear as yours. |
Thanks! I wish I had checked my git config before that first commit - the fig8 email account was retired just at the beginning of the year. |
This improves appearance of images on systems with wide gamut displays, e.g., Retina iMacs.
Pull Request Checklist
Description
Images served by 'nikola serve -b' looked flat on my iMac with retina display in comparison to the corresponding original images. Interactive testing with Pillow's Image.open and Image.save revealed that it did not automatically copy 'icc_profile' image info.
If it would be better for me to open an issue in the python-pillow/Pillow project, please let me know. Thanks!
See the mention of available options for https://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.save.