Hi,
I've added helper functions for color space conversions from RGB to the XYZ color space and from there to the CIE LAB color space (and the appropriate backward conversions). There are a few hard coded assumptions (e.g. the RGB value being in the sRGB color space and always using D65 as the white point for the Lab conversions) but I think that's fine for now.
I've also created some unit tests for these new conversions.
My next goal is to create a color replacement filter based on the distance between the colors in the Lab space.
Please feel free to suggest any improvement to this code.
Hi, I've added helper functions for color space conversions from RGB to the XYZ color space and from there to the CIE LAB color space (and the appropriate backward conversions). There are a few hard coded assumptions (e.g. the RGB value being in the sRGB color space and always using D65 as the white point for the Lab conversions) but I think that's fine for now. I've also created some unit tests for these new conversions.
My next goal is to create a color replacement filter based on the distance between the colors in the Lab space.
Please feel free to suggest any improvement to this code.