convert between sRGB and CIEXYZ, 色域色彩相关

转载自
How to convert between sRGB and CIEXYZ

How to convert between sRGB and CIEXYZ

Technote 09 Aug 2017

sRGB 是常见的一个图像标准
cie xyz 是评估人眼视觉 常用的一个标准

1. sRGB

The “s” in sRGB stands for “standard” and it is the lowest common denominator in color spaces. It was developed in the 1990s to provide a universal usable color space for display and printers of the time. While there are many different and larger color spaces available, sRGB is still the de facto standard for RGB image data.

2. CIE-XYZ

CIE (Commission Internationale de l’Éclairage) stands for the International Commission on Illumination, which established color spaces based on colors that can be perceived by the human eye. XYZ does not incorporate negative numbers and instead uses tristimulus values to define the color space that can be seen by the human eye. X represents the linear combination of the cone response non-negative curves created. Y represents luminance and Z is defined as almost equal to blue.

3. How to Convert

两者之前如何转换很多人不太清楚。
首先 sRGB 转换为 XYZ, 需要首先对 sRGB 反gamma处理变为 linear sRGB,
在通过矩阵转换 变为 XYZ。

XYZ 转换为sRGB则是相反的操作: 首先通过矩阵转换将 XYZ变为linear sRGB, 然后 gamma处理 得到sRGB.

3.1 sRGB to XYZ

a. sRGB to sRGB’ - Linearize the sRGB Data

sRGB data from a camera, especially when provided in 8bit is normally non-linear, shows the alleged gamma function. We define sRGB as the original camera data with the gamma function applied and sRGB’ as the linearized representation.

Please note that we first scale the sRGB data into a range of [0…1], so for 8bit data, we divide all values by 255.

The following calculation is the same for the three channel R, G, and B, which we show with the generically V and V’.
在这里插入图片描述

b. sRGB’ to XYZ - apply transformation matrix

A standardized 3x3 matrix describes how to convert from sRGB’ data to CIE-XYZ data.

在这里插入图片描述

As a quick reminder for those who implement with a tool that does not support matrix calculation easily (e.g. MS-Excel), the calculation of Y as a single equation is here.

在这里插入图片描述

Side note: When we say that Y represents the brightness, we see that green contributes the most and that blue has only a minor effect.

One more Side note: In case you compare your results with the results you get from tools that use an ICC profile (e.g. apply form in Mathworks Matlab) please note: the conversion shown here results into CIE-XYZ data with a reference white point of D65, as defined in the sRGB definition. ICC-Profiles always use D50 as reference white, which you should be aware of when calculating from XYZ to LAB or are comparing to these results.

3.2 XYZ to sRGB

在这里插入图片描述

4. 参考

1 Calculating RGB↔XYZ matrix (https://mina86.com/2019/srgb-xyz-matrix/)
2 Imatest 測CCM係數的方法: https://www.twblogs.net/a/5b8d00542b7177188338e917
3 CIE Color Calculator :http://www.brucelindbloom.com/index.html?ColorCalculator.html
4. COLOR: DETERMINING A FORWARD MATRIX FOR YOUR CAMERA:(https://www.strollswithmydog.com/determining-forward-color-matrix/)
5. Color conversion matrices in digital cameras: a tutorial :(https://www.spiedigitallibrary.org/journals/optical-engineering/volume-59/issue-11/110801/Color-conversion-matrices-in-digital-cameras-a-tutorial/10.1117/1.OE.59.11.110801.full?SSO=1)
6. LINEAR COLOR: APPLYING THE FORWARD MATRIX : (https://www.strollswithmydog.com/apply-forward-color-matrix/)

猜你喜欢

转载自blog.csdn.net/tywwwww/article/details/129745332