Repository navigation
Convert CMYK to RGB like Google Chrome - #2699
Merged
Merged
Conversation
Member
Author
|
I'm all for better CMYK handling. Wouldn't it be easier to better to simply read the icc profile from the image and then use |
Member
|
I think doing things intelligently when we have lcms and image profiles is a good change in general, but it's going to be intrusive and a noticeable change in behavior for people relying on the library. This PR makes sense in absence of that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



There is no easy way to convert CMYK to RGB without complicated color management. But there are some approximations. Pillow used to use the simplest one, which, for example, could be found there. It is not too accurate and produces very dark images. On the other hand, I found this formulas which produces far better result.
or in one equation:
Original CMYK image opened in Safari (and probably how it should looks like with correct color management)

Converted to RGB using the new formula and also CMYK image looks absolutely the same in Google Chrome

Converted to RGB using the old formula
