Concise Way to Describe Colour Spaces
Posted: Wed Jul 01, 2015 10:13 am
Hi,
I'm (still) designing a native file format for my OS to describe monitors. I want to generate graphics in a device independent colour space (most likely, it'll be the CIE XYZ colour space with D65 as the white point, with no gamma); and then convert the device independent colours into whatever the monitor happens to use; and mostly need a way to parameterise this conversion.
For convenience (so I can "auto-convert" the monitor's EDID into my file format if/when the OS doesn't have a suitable file for the monitor); where possible, the data I use to describe the monitor's colour space will need to be derived from the values that the monitor's EDID provides. EDID provides:
Typically a monitor only has 3 channels, one for each primary colour (e.g. red, green, blue). I want to be able to handle any number of channels from 1 channel (e.g. monochrome) to 4 channels. For 4 channels, it could be "red, green, yellow, blue" (note: apparently there are some recent TVs that use this system instead of RGB), or "red, green, blue, white", or "cyan, magenta, yellow, black", or it could be RGB where the extra channel is used for alpha/transparency (which I assume is necessary for "augmented reality" displays like Microsoft's HoloLens), or anything else. Mostly this is about future proofing (and not so much about typical hardware we use today).
Because the source colour space will be standardised for the OS; the correct chromatic adaptation matrix for the monitor and the correct "XYZ to whatever" matrix for the monitor can be derived from EDID's information and then combined. Essentially, for 3 channels/primaries my display information only needs a single combined matrix (and the gamma value). For 4 channels/primaries, I assume I can extrapolate from the matrix maths.
Basically; for each channel I'll have an "X multiplier", "Y multiplier" and "Z multiplier" to convert the source XYZ pixel colour into the monitor's colour space; and I assume this will work fine for all displays with 1 to 4 primary colours.
In addition, I'd have an enumeration of "special channel" types. This would include alpha/transparency; but also black and white, because the conversion from (e.g.) RGB to RGBW or from CMY to CMYK involves finding the minimum of the original 3 primaries and can't be done with matrix multiplication.
Questions!
Are there any cases where "channel type [primary colour, transparency, black, white], X multiplier, Y multiplier, Z multiplier" (for up to 4 channels) isn't adequate, or any other reason why this might not be a good idea?
For the chromatic adaptation transform; there's multiple different alternatives (XYZ scaling, Bradford, Von Kries, Sharp CAT, CMCCAT2000). Does anyone know which is likely to give the most accurate results? For example, assume I have 2 monitors side-by-side where one uses one white point and another uses a different white point; which chromatic adaptation transform is most likely to make colours look the same on both monitors?
Does anyone know how to convert EDID's "(x, y) chromaticity coord for default whitepoint" into any of the chromatic adaptation transform matrices? Note: I think I've found an answer to this question on this web page.
Does anyone know how to convert EDID's "(x, y) chromaticity coord for primary colours" into an "XYZ to whatever" transformation matrix? I can find plenty of pre-computed matrices for specific cases (e.g. "XYZ to xyY", "XYZ to sRGC", etc), but haven't found anything describing how these are created. Note: I think I've found an answer to this question on this web page.
Is there anything else I've overlooked or falsely assumed or messed up?
Thanks,
Brendan
I'm (still) designing a native file format for my OS to describe monitors. I want to generate graphics in a device independent colour space (most likely, it'll be the CIE XYZ colour space with D65 as the white point, with no gamma); and then convert the device independent colours into whatever the monitor happens to use; and mostly need a way to parameterise this conversion.
For convenience (so I can "auto-convert" the monitor's EDID into my file format if/when the OS doesn't have a suitable file for the monitor); where possible, the data I use to describe the monitor's colour space will need to be derived from the values that the monitor's EDID provides. EDID provides:
- The (x, y) chromaticity coords (based on the CIE 1931 2° Chromaticity Chart) for each of the 3 primary colours (e.g. red, green, blue)
- The (x, y) chromaticity coord (based on the CIE 1931 2° Chromaticity Chart) for monitor's default white point. Note: I will be assuming the monitor is always using its default whitepoint.
- The monitor's gamma information (either an exponent or an "sRGB" flag)
- Correct the white point (chromatic adaptation); which mostly involves a matrix multiplication
- Converting from one colour space to another; which mostly involves a matrix multiplication again
- Doing gamma encoding to adjust the linear/"no gamma" values into whatever the monitor wants; which mostly involves exponentiation (e.g. "out = in**2.2") but gets slightly trickier for sRGB.
Typically a monitor only has 3 channels, one for each primary colour (e.g. red, green, blue). I want to be able to handle any number of channels from 1 channel (e.g. monochrome) to 4 channels. For 4 channels, it could be "red, green, yellow, blue" (note: apparently there are some recent TVs that use this system instead of RGB), or "red, green, blue, white", or "cyan, magenta, yellow, black", or it could be RGB where the extra channel is used for alpha/transparency (which I assume is necessary for "augmented reality" displays like Microsoft's HoloLens), or anything else. Mostly this is about future proofing (and not so much about typical hardware we use today).
Because the source colour space will be standardised for the OS; the correct chromatic adaptation matrix for the monitor and the correct "XYZ to whatever" matrix for the monitor can be derived from EDID's information and then combined. Essentially, for 3 channels/primaries my display information only needs a single combined matrix (and the gamma value). For 4 channels/primaries, I assume I can extrapolate from the matrix maths.
Basically; for each channel I'll have an "X multiplier", "Y multiplier" and "Z multiplier" to convert the source XYZ pixel colour into the monitor's colour space; and I assume this will work fine for all displays with 1 to 4 primary colours.
In addition, I'd have an enumeration of "special channel" types. This would include alpha/transparency; but also black and white, because the conversion from (e.g.) RGB to RGBW or from CMY to CMYK involves finding the minimum of the original 3 primaries and can't be done with matrix multiplication.
Questions!
Are there any cases where "channel type [primary colour, transparency, black, white], X multiplier, Y multiplier, Z multiplier" (for up to 4 channels) isn't adequate, or any other reason why this might not be a good idea?
For the chromatic adaptation transform; there's multiple different alternatives (XYZ scaling, Bradford, Von Kries, Sharp CAT, CMCCAT2000). Does anyone know which is likely to give the most accurate results? For example, assume I have 2 monitors side-by-side where one uses one white point and another uses a different white point; which chromatic adaptation transform is most likely to make colours look the same on both monitors?
Does anyone know how to convert EDID's "(x, y) chromaticity coord for default whitepoint" into any of the chromatic adaptation transform matrices? Note: I think I've found an answer to this question on this web page.
Does anyone know how to convert EDID's "(x, y) chromaticity coord for primary colours" into an "XYZ to whatever" transformation matrix? I can find plenty of pre-computed matrices for specific cases (e.g. "XYZ to xyY", "XYZ to sRGC", etc), but haven't found anything describing how these are created. Note: I think I've found an answer to this question on this web page.
Is there anything else I've overlooked or falsely assumed or messed up?
Thanks,
Brendan