-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Close #122 - Add CMYK representation #123
Conversation
4a5277a
to
2e34be1
Compare
Thank you for your contribution. When working on We face similar problems with CIELAB, but at least sRGB's gamut is a subset of the "CIELAB gamut". Could you please clarify how these issues are addressed here? Where does the conversion formula come from? [1] https://en.wikipedia.org/wiki/CMYK_color_model#Conversion |
@sharkdp - as a formula reference during writing the code, I used both the bash script from ticket #122 and https://www.rapidtables.com/convert/color/rgb-to-cmyk.html. The top SO answer here (https://stackoverflow.com/q/2426432) says -
The used formula does no apply any Color Profile. I can find the same algorithm either used or mentioned at different places online -
|
Thank you, @aeter !
@sharkdp , I'll follow @aeter and the references provided by him... As at a first glance this feature will not be used for physical representation, direct conversion would be an entrance for future improvements... As I mentioned in #122 , due to a very specific issue and for an "on screen" representation provided by a specific software, a direct conversion was all I needed... But I understand your point... A better approach for physical conversion, would be using Hue but, even this way, we would still dependent on specific profiles to achieve a satisfactory result... Thank you for the great work, guys! EDIT Just for clarification, for example, here's a sample from a device profile, from one of my printers;
Based on my profile, theoretically, I can reproduce the whole CMYK gamut, but not sRGB's one... |
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.
Ok - thank you for your explanations!
Tests: ``` $ pastel format cmyk 'rgb(255, 255, 255)' cmyk(0, 0, 0, 0) $ pastel format cmyk 'rgb(0, 0, 0)' cmyk(0, 0, 0, 100) $ pastel format cmyk 'rgb(19, 19, 1)' cmyk(0, 0, 95, 93) $ pastel format cmyk blue cmyk(100, 100, 0, 0) $ pastel format cmyk 'rgb(55, 55, 55)' cmyk(0, 0, 0, 78) $ pastel format cmyk 'rgb(136, 117, 78)' cmyk(0, 14, 43, 47) $ pastel format cmyk 'rgb(143, 114, 75)' cmyk(0, 20, 48, 44) $ pastel format cmyk 'rgb(143, 111, 76)' cmyk(0, 22, 47, 44) ```
2e34be1
to
bb5f180
Compare
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
==========================================
+ Coverage 69.28% 69.59% +0.30%
==========================================
Files 32 32
Lines 2676 2723 +47
==========================================
+ Hits 1854 1895 +41
- Misses 822 828 +6
Continue to review full report at Codecov.
|
Adds a CMYK representation. References #122
Tested also with https://www.rapidtables.com/convert/color/rgb-to-cmyk.html
Tests: