-
Notifications
You must be signed in to change notification settings - Fork 60
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
Implement LMS color space and CVD simulation #352
Comments
Hi, this sounds like an interesting project! I'll have to read up on this later, when I'm less tired (it's getting late over here). Regardless, I think it make sense to add some form of LMS, probably parameterized on which matrix it uses. 🙂 As for CVD simulation, that sounds like it fits better as a separate crate, if I understand it correctly. Palette can definitely be the building blocks, with LMS being the missing step, but the simulation looks like it may be a whole field of its own. Correct me if I'm wrong. 🤔
XYZ from a spectrum is quite straight forward, but that doesn't prevent supporting LMS too. 😁 |
Yeah, I could see why you might want it in a separate crate. I still think it would be good to have it as part of palette, for a similar reason that the color difference metrics are in palette: They are a very common use case for certain color spaces. I don't have a super strong opinion one way or the other though. |
I'm looking to start implementing LMS now, is there a color that I should use for reference as to how to implement it? |
Let's start with the LMS and give the rest some thought. I need to understand how much work it would be to maintain it and keep it up to date with the development in the area. I don't have the personal bandwidth to keep up with the research on my own, even though it's interesting, so I have to prioritize a bit. The best scenario is if we can find some parts that are generic, established/standardized or very commonly used. For LMS, I think you can look at XYZ. It's a plain tri-stimulus space without a lot of extra (as opposed to RGB). But you can also take a look at how the RGB standards work, it may help. I'm also trying to write some sort of guide or check list for how to add a new color type, but don't wait for that before starting. You probably know this better than I do, but my impression is that it would make sense to have a representation of the conversion matrix as the meta variable (XYZ has the reference white point for convenience). Or are they interchangeable once converted? |
To respond to #376 (comment)
As I said, I'm not an expert in the area, so please correct me if I'm missing something, but my understanding so far is that there are a couple of different ways of using LMS:
I don't consider these two cases as mutually exclusive, but case 1 is much more well defined and supported at the moment. I think case 2 could also work within the same system, but it's not something I have tried yet. |
Thanks for looking into this! I've been doing some research, and I'm slighlty confused by what the Wikipedia article on LMS colour spaces states:
https://en.wikipedia.org/wiki/LMS_color_space ... and what Stockman & Sharpe (2000) write:
Stockman, A. & Sharpe, L. T. The spectral sensitivities of the middle- and long-wavelength-sensitive cones derived from measurements in observers of known genotype. Vision Research 40, 1711–1737 (2000). I will have to give the Stockman & Sharpe paper a more thorough read, but I feel this is a generally doable. |
It's also a matter of practicality, at some level. If there is a specific use case for using matrices, no matter if they are perfect or not, then there's value in supporting them. I think that's at least a good starting point for this feature. |
I have done most of the job of implementing LMS in #400. I will limit this issue to that part and open a separate one for CVD simulation. |
I was considering making my own crate for this, but figured it would probably make sense in the main palette crate. Just wanted to ask before I started work on it.
I have a project that needs color vision deficiency (CVD) simulation, and I think it would be a good fit for Palette. Along the way, this would involve implementing the LMS color space, which I think would also be a good fit for Palette, since CVD simulation is not its only practical use (could even relate to #64? Spectrum to LMS makes arguably more sense).
The method of simulating CVD that I am planning on implementing is Brettel & Mollon 1997, as per the Review of Open Source Color Blindness Simulations by DaltonLens, which I highly recommend reading as it seems to be the only comprehensive overview of the topic. I would like input if someone thinks that another CVD simulation method would be a better fit, or if implementing multiple methods would be better, which I would also be happy to do.
Thank you for the input!
The text was updated successfully, but these errors were encountered: