From 9a207da36845e18dc4f747d8ecc98fbc0e11545c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 22 Jan 2024 16:37:47 -0500 Subject: [PATCH] LibGfx/ICC: Fix small mistake from #22700 Doesn't matter if both profiles are sRGB since inv(A) * A == A * inv(A), but when converting e.g. a P3 image to sRGB, the colors are very off if the matrices are the wrong way round here. --- Userland/Libraries/LibGfx/ICC/Profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/ICC/Profile.cpp b/Userland/Libraries/LibGfx/ICC/Profile.cpp index 041e571c0b..0f5df41264 100644 --- a/Userland/Libraries/LibGfx/ICC/Profile.cpp +++ b/Userland/Libraries/LibGfx/ICC/Profile.cpp @@ -1625,7 +1625,7 @@ Optional Profile::matrix_matrix_conversion(Profile const LutCurveType sourceGreenTRC = *source_profile.m_tag_table.get(greenTRCTag).value(); LutCurveType sourceBlueTRC = *source_profile.m_tag_table.get(blueTRCTag).value(); - FloatMatrix3x3 matrix = source_profile.rgb_to_xyz_matrix() * MUST(xyz_to_rgb_matrix()); + FloatMatrix3x3 matrix = MUST(xyz_to_rgb_matrix()) * source_profile.rgb_to_xyz_matrix(); LutCurveType destinationRedTRC = *m_tag_table.get(redTRCTag).value(); LutCurveType destinationGreenTRC = *m_tag_table.get(greenTRCTag).value();