mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 05:34:58 +00:00
LibGfx/ICC: Improve XYZ coordinates of gray colors
In XYZ space, gray doesn't have three equal values. Instead, it is a line through the whitepoint. (Multiplying by the whitepoint has the same effect as multiplying the sRGB matrix with a (g, g, g) vector, since the numbers on the matrix's rows add up to the whitepoint.) Fixes the very slight red tint on all the figures in chapter 4 of the PDF 1.7 spec.
This commit is contained in:
parent
726fa41d4a
commit
bcb1e548f1
1 changed files with 2 additions and 1 deletions
|
@ -1287,7 +1287,8 @@ ErrorOr<FloatVector3> Profile::to_pcs(ReadonlyBytes color) const
|
|||
// ICC v4, F.2 grayTRCTag
|
||||
// "connection = grayTRC[device]"
|
||||
float gray = evaluate_curve(grayTRCTag, color[0] / 255.f);
|
||||
return FloatVector3 { gray, gray, gray };
|
||||
FloatVector3 white { pcs_illuminant().X, pcs_illuminant().Y, pcs_illuminant().Z };
|
||||
return white * gray;
|
||||
}
|
||||
|
||||
// FIXME: Per ICC v4, A.1 General, this should also handle HLS, HSV, YCbCr.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue