Hacker News new | ask | show | jobs
by LegionMammal978 50 days ago
sRGB has bugged me from the start, since it's not even clear to me which actual matrix to use to convert between linear sRGB colors and XYZ colors. I count at least 3 different matrices in IEC 61966-2-1, each of which I have seen different people ascribe to as the true version:

1. The matrix implied by the reference primaries in Table 1: [X; Y; Z] = [506752/1228815, 87098/409605, 7918/409605; 87881/245763, 175762/245763, 87881/737289; 12673/70218, 12673/175545, 1001167/1053270]*[R; G; B].

2. The matrix in section 5.2: [X; Y; Z] = [1031/2500, 447/1250, 361/2000; 1063/5000, 447/625, 361/5000; 193/10000, 149/1250, 1901/2000]*[R; G; B].

3. The inverse of the matrix in section 5.3: [X; Y; Z] = [248898325000/603542646087, 71938950000/201180882029, 36311670000/201180882029; 128304856250/603542646087, 143878592500/201180882029, 14525360000/201180882029; 11646692500/603542646087, 23977515000/201180882029, 191221850000/201180882029]*[R; G; B].

The distinction starts to matter for 16-bit color. The CSS people seem to take the position that the matrix implied by primaries is the true version, but meanwhile, the same document's Annex F (in Amd. 1) seems to suggest that the 5.2 matrix is the true version, and that the 5.3 matrix should be rederived to the increased precision. There's no easy way to decide, as far as I can tell.

Meanwhile, I agree with the author that the ICC's black-point finagling in their published profiles has not helped with the confusion over what exactly sRGB colors are supposed to map to.

2 comments

It's perfectly fine for fingerprinting though. Innocuous artifacts in file formats such as custom matrices, digits on the seventh decimal position of a floating point number or millisecond-precision timestamps allow identification and cross-referencing of internet users.

Just last week I noticed that when a reddit user uploads a screenshot taken on MacOS as PNG image to a reddit post, the PNG will still contain uniquely identifying information about the monitor that is attached to the MacOS system and when it was last calibrated. You can deduce type of Macbook they are using from the screen resolution and see when they switched machines once you notice a different monitor calibration timestamp. Just from a single PNG image that was uploaded by the user themselves. If those two pieces of information are not stored in the PNG you know that they must be Windows or Linux user.

It's these small breadcrumbs all over the place which make forensics so interesting.

If you're using sRGB with 16bit color you already have problems. It is an 8bit per color hack that worked perfectly well with CRTs and early LCDs. There were multiple different hacky versions with different vendors that were visually indistinguishable on displays of the day.

Even most modern displays are not really capable of more than 10bit color (RGB miniLED and QD-OLED barely are). Even REC2020 doesn't need 16bit.

sRGB doesn't even have a consistent gamma, and it's not anywhere close to uniformly covering the color volume. Why use it? DCI-P3 works fine.

Your eye also doesn’t have a consistent gamma, nor does the camera, now does any viewing technology. If you’re complaining about the slight linear section of many gamma curves, they are very important for avoiding various artifacts.
Well, there's all sort of different problems, but most modern display technologies both in software visual profile and hardware implementation use LUTs. When sRGB was born the monitors were unable to even meet it as a spec so some crazy simplifications were fine. Now we're using those bits to drive HDR monitors over much larger color volumes and dynamic range, but it's hard to move on from the "good enough" legacy of sRGB.

Certainly, eyes don't have a consistent gamma, they don't even match between people, much less outside the foveal field.

LUTs don’t magically add color volume, change the possible colors or dynamic range, or add much at all to the physics of a display. They’re usually used to reduce bit depth. They do not add more low or high colors than the screen physics started with.