1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

ICC: Add Profile::to_lab()

This can be used to convert a profile-dependent color to the L*a*b*
color space.

(I'd like to use this to implement the DeltaE (CIE 2000) algorithm,
which is a metric for how similar two colors are perceived.
(And I'd like to use that to evaluate color conversion roundtrip
quality, once I've implemented full conversions.)
This commit is contained in:
Nico Weber 2023-04-29 15:16:22 -04:00 committed by Jelle Raaijmakers
parent 5fc11a316f
commit f3dbfb85d9
3 changed files with 110 additions and 0 deletions

View file

@ -266,6 +266,13 @@ public:
// Call connection_space() to find out the space the result is in.
ErrorOr<FloatVector3> to_pcs(ReadonlyBytes);
struct CIELAB {
float L; // L*
float a; // a*
float b; // b*
};
ErrorOr<CIELAB> to_lab(ReadonlyBytes);
// Only call these if you know that this is an RGB matrix-based profile.
XYZ const& red_matrix_column() const;
XYZ const& green_matrix_column() const;