Comments (2)
Hi Mike, thanks for reaching out! :-)
I'd guess that the values colormine gives you are wrong.
My process for the conversion you specified is following:
- I assume that the RGB working space is sRGB (note that this can be changed in
RGBColor
constructor), which is the most commonly used - I convert it to linear RGB using the inverse companding process defined in the working space - for sRGB I use the process described here
- After I got RGB with linear channels, I convert it to XYZ using a conversion matrix that is constructed from the chromaticity primaries of the sRGB color space, the result will be an XYZ color with reference white point D65 (because sRGB has reference white point D65)
- Then I need to do convert XYZ to LAB color space. But when we talk about LAB color space, we usually mean LAB color space with reference white point D50 (Photoshop uses it as well), so a chromatic adaptation from D65 to D50 needs to be performed
- For the chromatic adaptation, I use the standard Von Kries chromatic adaptation that transforms the colors to LMS color space inside, and I am using Bradford LMS transform matrix (also used in CMCCAT97) for that
- After the chromatic adaptation, I have an XYZ color with reference to D50, which I can convert to LAB using this method
This whole process in Colourful is designed based on the information I collected from Bruce Lindbloom's website with some of my own research of the topic (mainly regarding the existing chromatic adaptation methods).
I tested the input values with this calculator: http://www.brucelindbloom.com/index.html?ColorCalculator.html and the values match. Try entering 0, 1, 0 to RGB, the default settings of that calculator should be the same as default settings of ColourfulConverter
class, then the LAB coefficients should match the ones generated by Colourful.
For a second test, try Wolfram Alpha, their values also agree with mine.
My process is very thorough there, and I assume that colormine just multiplies the RGB vector with some hardcoded matrix to get the XYZ values, which might not be 100% correct.
If you face any other issues, feel free to ask :-)
from colourful.
Closing this now. Feel free to reopen for a follow-up.
from colourful.
Related Issues (20)
- Convert error, return type is not supported: VS2022Community HOT 2
- How to draw Chromaticities(cie xy) diagram HOT 4
- RobiniaDocs API Explorer HOT 1
- SIMD Support HOT 1
- Chromaticity HOT 1
- Implement Deconstruct for color structs HOT 1
- Implement helper methods/properties to determine if a color is valid for human eyes (i.e. within the visible spectrum)
- Implement color matching functions
- Thread safety of ColourfulConverter HOT 3
- Add Oklab color space
- Add XYB color space
- Add helper to maximize RGB intensity HOT 1
- Add helpers to crop values in range HOT 2
- Add 8bit-per-channel RGB space (for easier integration with the outside)
- Improve conversion strategy from xy chromaticity to automatically normalize the intensity
- How to convert LAB to System.Drawing.Color in .Net 5?
- .NET Standard 2.0 drawing support HOT 2
- Document how to implement a custom color space
- Add more full examples to the documentation
- Possible bug on Lab to RGB conversion HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colourful.